Saturday, January 24, 2015

Mount Moto G2 in Fedora 20

For some reason on my desktop, plugging in the MotoG2 didn't auto mount it. With the Netbook I had got this to happen automatically.

But my terrible memory meant that I forgot what I did. So once again I was searching for a way to get this resolved when I found this site.

The site had detailed instruction on getting an Android phone to mount in Linux. Here's what I did specifically in Fedora 20.

  1. First I installed the relevant packages
    • yum install gvfs-mtp kio_mtp libmtp simple-mtpfs
  2. Then used the command to find the list of phones
    •  simple-mtpfs -l
  3. Finally mount using the following command
    •  simple-mtpfs
  4. To remove, all that was required to do was
    • sudo umount <mount-point-directory>
 As simple as that!

Setting up a restricted Sudoer on Fedora 20

Since my kids also use my primary system, I no longer could give full sudo access to the default family user account and need to ensure that only I could administer the system.

On a previous occasion I had manually edited the /etc/sudoers file. But this time I learnt about a command called visudo.

The visudo command is similar to vi with the added benefit that when the editor is closed it also validates the file.

My main aim was to enable using the truecrypt utility from the normal user rather than from root.

With the help of this command I was able to make the change to the sudoers file. Below I've listed all the options I tried with my understanding of why they worked or didn't.

  1. I create an alias for all the commands I wanted to be able to run as a normal user. This is a short cut instead of having to use this list when granting users permissions
    • Cmnd_Alias TRUECRPT = /bin/mount, /bin/umount, /usr/bin/truecrypt
  2. Next step was to all the specific user access. In this example, username is the login user.
    • username    ALL=(ALL)       ALL
      • The command resulted in the user being able to run all the commands after being prompted for the username's password.
      • This was the previous setting that I wanted to remove.
    • username   ALL=(TRUECRPT)
      • This enabled only the relevant commands to be run by the user after the user enter their password when prompted.
    • username   ALL=(TRUECRPT) NOPASSWD: ALL
      • This resulted in a syntax error detected by visudo
    • username   ALL=(TRUECRPT) NOPASSWD: TRUECRYPT
      • This resulted in a syntax error detected by visudo
    • username   ALL=NOPASSWD: TRUECRPT
      • This was the command was the one that worked for me. It allowed the use of truecrypt and it's automounted partitions to be accessed without prompting the user for passwords.
With this I finally (think) I've understood how to configure sudoers. I'll update this post the next time I need to reconfigure it.

Saturday, September 6, 2014

Configuring the Samsung N150+ for sending emails

I've been experimenting with attempting to send emails from the command line but realized that I had never configured the laptop to do so.

A short search revealed this blog which had simple steps to help configure email. I've copied those here too.

su
yum install sendmail-cf
cd /etc/mail
cp sendmail.mc sendmail.mc.original
cp sendmail.cf sendmail.cf.original
vi sendmail.mc

Remove dnl from the beginning of  these lines: (Copy and comment out the original line for safety)
  • LOCAL_DOMAIN (‘localhost.localdomain’) dnl
  • FEATURE (masquerade_envelope) dnl
  • FEATURE (masquerade_entire_domain) dnl
Enter my domain name "<machine>.<domain>.home" at these two lines:
  • MASQUERADE_AS (‘machine.domain.home’) dnl 
  • MASQUERADE_DOMAIN (machine.domain.home) dnl

su
cd /etc/mail
m4 /etc/mail/sendmail.mc > /etc/sendmail.cf
service sendmail restart
 
Finally a short test:

sendmail -s "Testing" testEmail@test.domain < /dev/null

I realized that I also had to check my spam email for this mail :-)

Sunday, October 20, 2013

Selecting a new camera

A few years back I was in the market for a new camera. The variety of options out there really made it hard for me to make a selection!

I like to think I'm a photo enthusiast. But I finally acknowledged that I don't get too much into the technicalities of photography but I enjoy taking photographs which essentially means composing them and framing the photograph. Secondly I was looking for a camera I could use on a safari I was planning to take as well as later to capture moments in get-togethers with family and friends. Occasionally I would like to indulge in "photography" of landscapes from a hobby perspective. So I was looking for something that would be generalistic and I could use the same camera in various situations.

So with that background I'd like to share the process I went through to make my camera decision.

The first decision to make is identify your budget. Trust me, this is important as without this you would not know when to stop. Having said this, I'd say keep a budget range i.e., what you you would like to spend and the absolute limit you should not cross. The latter is a financial decision and should be made without emotion and should be used to ensure you do not over spend.

Now we come to cameras. One of the decisions is whether to go for a "still" camera versus a "video" camera. With today's technology the line between these is getting thinner and thinner. I would recommend a video camera but with one major caveat. Video cameras require a lot of post processing, i.e., after the shot, a lot of time will be spent to edit the shot or even to identify frames to print. Another downside of video cameras (as opposed to still cameras) is low light shooting. Most commercial video cameras will not come with a "flash" option. So if you plan to take indoor shots it might be better going with a still camera that has video shooting capabilities.

For this entry I'm going down the path of choosing a "still" camera and hence from now on we won't talk about video cameras.

The next decision is whether to go with a DSLR or a semi-DSLR or a point-and-shoot digital camera. Without a doubt the quality of a DSLR is the best but it is not as versatile for 80% of the users I know off.
Unless you are getting into photography professionally or as a hobby I'd not recommend going for a DSLR. Another reason is the cost. The bare minimum "body" is rather cheap when you compare with the lenses you'll have to buy to get a decent zoom or wide angle shot. Not that the body is really cheap but keep in mind that with the DSLR costs can easily shoot up to get "what you want" out of the picture.
Yet another reason I didn't go for it was the need to change lenses for different shots. And then when you have too many lenses, carrying them around is an issue as well as taking a shot which may make the camera to heavy to hold and may mandate a tripod.
While they are the best, I wouldn't recommend DSLR for those of us who do not want to get into the technicalities of photography which includes understanding the mechanics of light and lenses as well as the time involved in selecting the right lens and switching them and of course the cost of it all!

It might be quite obvious from my paragraph above, the reasons I didn't go for the DSLR. This meant I look at the point and shoots or the semi-DSLRs. However, since both of these pretty much have "fixed" lenses, my research recommended getting a camera with the maximum zoom as this is the one thing that cannot be changed for such cameras. Considering I was going on a safari, I essentially looked for cameras with the maximum available zoom.

Now even with "Zoom" ensure you look for optical zoom. This is essentially zoom made available with lenses giving you the highest quality picture without distortion. Digital zoom would at some point distort and pixelate the picture and quality goes down as zoom goes up. Of course the downside is that as optical zoom goes up the size of the camera also increases.

Hence in this case you would have to balance the size which decides portability of the camera and the zoom desired. In my case, I just went looking for the cameras which had the best zoom. I found a Nikon, a Cannon and an Olympus all give me optical zooms in the range of 36x to 40x.

The next thing I did was to go see these cameras and look at the software loaded on the camera itself. In my case I couldn't find the Olympus so I ended up comparing the Canon and the Nikon.

I didn't do a very technical comparison. I liked both the interfaces (software).
I found the Canon to provide better quality images which I compared by taking a photograph of an advertisment at full optical zoom, then reviewing the picture at full zoom on the camera itself. The Canon had a shaper edges on the image than the Nikon.
The Canon was a bit more expensive than the Nikon but both were within my budget and so I didn't worry a lot about costs.
Next I looked at the video capabilities. Nikon won here because it offered full HD (1280) while the Canon offered semi HD (720). Secondly the Nikon also provided high speed recording which meant more frames per second albeit not at the highest quality. But still that meant I could shoot slow motion videos!
The Nikon also allowed one to take a "still" photo while taking a video recording which I've found to be an extremely useful feature and would recommend cameras that have this feature.

Ultimately I went for the Nikon with the highest zoom which esentially meant a semi-DSLR.

The money I saved (from buying the Canon) I invested in buying a second battery (which I strongly recommend) and a spare charger. The Nikon battery could only be charged if it's in the camera and I wanted the ability to charge my spare without using the camera.

Another suggestion when buying memory for your camera is to look for High speed cards. The standard cards are slow and I would strongly recommend buying high speed card to take your shots as that makes the camera respond faster. Have a look at the following websites to understand about the speed of the memory card:
The downside with semi-DSLR is that it is slow because of the motor used for zooming and focusing. DSLR would be a lot quicker one you get the hang of it but with a semi-DSLR taking the shot may take a while.

Hope you found this useful. In brief, if going for a still camera, decide your budget and get the camera with the highest zoom that fits the budget. And one last piece of advice. Technology changes quickly so do not spend too much on the camera. Look at useage requirements for the next two years before buying!

Happy buying!

Thursday, October 3, 2013

Setting up Tikona with D-Link DSL-2750U

I bought a D-Link DSL-2750U which is in my opinion the most versatile router I could find.

Versatile, because I can use it with an ADSL/ADSL+ provider like BSNL or a 3G provider using its USB port or a provider like Tikona that provides internet based on a ethernet connection.

Also its a N300 based router so I expect it to give me good Wifi Speeds. (Haven't tested that yet.)

Anyway, to cut my ramblings short, the intent of this blog entry is to document how I got the router to work with the help of Tikona's tech support.

Here are the steps:
  1. Reset the router to factory settings by pressing the Reset button under the router
  2. Connect a LAN cable from LAN port 1 to the computer
  3. Go to http://192.168.1.1/
  4. Enter the default user name and password (admin/admin)
  5. In the Local Network disable the DHCP server
  6. Then setup the wireless by going to the Wireless Basic option
  7. There setup the network SID (whatever you want)
  8. Hit apply
  9. Go to Wireless Advanced
  10. Select security as Auto(WPA/WPA2)
  11. Enter the network key (whatever you want)
  12. Hit Apply
  13. Reboot the router
  14. Disconnect the LAN cable from the computer
  15. Connect the LAN cable from Tikona to the computer
  16. Go to the login page (1.254.254.254) but do not login
  17. Disconnect the LAN cable from the computer
  18. Connect the cable from Tikona to LAN port 1 of the router
  19. Connect the computer/laptop to the Wifi network setup earlier
  20. Go to the login page (1.254.254.254) on the computer and login
With that I could access the internet using Wifi and Tikona. Next step was to secure the Wifi (hiding the SID, changing the default password, etc.).

So the router has proved that it can work with Tikona too as long as the DHCP server is disabled. Hope someone finds this useful.

Update:
I found out later that I could only connect computers to the Wifi as every device needed to login. Neither my phones nor my TV could login to Tikona's web site. So I decided to go back  to the plain-old WiFi router I used to have to share Tikona's connection and use this one for my ADSL connection only.

Wednesday, October 2, 2013

Making my Pentium-S 75MHz a bit torrent client

So the Pentium-S at 75MHz is probably technical worse off than the phone I own. But it was the first PC I owned! I'm sentimentally attached to it. And I want to use it.

Hell, so I decided, why not make it the bit torrent client. Get Linux with Transmission and SSH installed and use it for only that. No data, so should it not work, I don't care. Just reformat and start again!

But here was the plan. Install puppy linux & transmission and I should be off!

But things are never that easy.

So, first problem I faced, that when I tried to install the Wary Puppy (5.3). It wouldn't boot from the CD to which the ISO was written! I vaguely remember that this was an issue with the kernel used for this distribution and that the system did not support this.

So what I had to do was to install a really old version of Red hat linux, in fact this was before they forked it to Fedora core and RHEL! At that time (2001) I used to subscribe to PCQuest and in March every year the magzine would provide a distribution called PCQLinux which was based on Redhat's Linux. I found that redhat linux 7.1 was the one that would boot and so I installed it!

Once the install completed and I was able to login I wanted to begin work on installing Wary puppy. But things went up in smoke! Literally. I was rebooting the system when a puff of smoke came out the back and the system refused to start working.

I suspected the power supply had conked off. So, I bravely went and unplugged everything and took the power supply off intending to take it the next day and get it replaced in the store. But I decided to run one last check before I did that. At that time I noticed that I seemed to be getting a live line on both the input sockets. Turns out the cable I was using had shorted and on closer investigation I found the place where it had shorted. It was blackened and I concluded that's where the puff of smoke came from. So my next step was to get a replacement cable, replug everything back in and test. Which I did and found it all working! DUH! When things go wrong check the cable FIRST!!

Anyway, with that sorted out and a week later when I found the time, I had the option of manually installing puppy following the instructions at these websites

  1. http://www.puppylinux.com/install.htm
  2. http://www.puppylinux.com/hard-puppy.htm
But then I was lazy so thought of finding a different way to do it. I'll leave manual installation as a last option.

So what i did was to pull the HDD from the Pentium S and put it into another system. Boot of the WaryPuppy USB, run universal installer & the grub installer to ensure booting from the HDD and then switch the HDD back to the Pentium-S.

Only trouble was it didn't boot. There was a wierd error (something like "urr! wee..."). I put that down to an incompatible kernel. So the next step was to write out the oldest puppy I could find, viz., 'puppy-216-seamonkey' to CD. This too didn't work and I realized it too used the 2.6 kernel.

I was eventually stumped and virtually gave up. However, one Sunday, I thought let's give it the old college try once more.

I did do that and found a link http://www.murga-linux.com/puppy/viewtopic.php?t=9965 that explained how to manually install and configure puppy using Lilo.

Here's a summary of what I finally did:
  1. Created a directory /boot/wary5.5
  2. Copied the vmlinuz and initrd.gz to this folder
  3. Copied puppy*.sfs to /boot
  4. Modified /etc/lilo.conf and added the following
    1. # Puppy Linux
    2. image = /boot/wary5.5/vmlinuz 
    3. root = /dev/ram0
    4. label = Puppy
    5. initrd = /boot/wary5.5/initrd.gz
    6. append = "pfix=ram"
    7. read-only
  5. Once I saved this file, I then ran lilo.
  6. Rebooted and puppy started working! Or so it seemed
  7. Next step was to free up some disk space and remove the PCQuest Linux 7.1 based on Redhat Linux 7.1
  8. For the record here's the partitions I set up on the 4GB disk
    1. 256 MB /boot
    2. 128 MB swap
    3. Rest all in a single root partition
Well the sad part was that puppy booted but I believe Wary Puppy couldn't load the drivers to read the hard disks.

After a while puppy would just drop to the "init" . At this point I kind of gave up and turned to the puppy linux community for help by posting this query on the forum.

After a couple more frustrating weekends trying out various suggestions, I was ready to give up.

Then one day, my PC refused to boot. A couple of times I tried and the same result, it hung after a while during the boot process. I was really disappointed and discouraged!

But come weekend, I prayed (really) and tried again, and the PC didn't boot but it gave a memory error! So, I opened up the unit, took off the four sticks of RAM, wiped them clean and reinserted them back into their respective slots. And this time the PC started up!

Next, I booted in PCQLinux 7.1, and copied across the files for puppy linux 2.0.2 opera version, modified the /etc/lilo.conf to boot using these files and rebooted the PC.

To my absolute delight, PUPPY booted up! I was thrilled. As another experiment I rebooted into PCQLinux7.1 and copied across the files for Puppy 4.1.2 and rebooted. That worked too! Now that I was on a roll, I gave Wary 5.5 another try, but this failed at the same point and refused to boot.

So now that the system was up, I started exploring it all and found that puppy202 was more responsive that puppy412. So I decided to stick with 202. Besides 202 came with transmission out of the box while 412 didn't.

Having done that, the next thing was to start a torrent. Unfortunately, the version of transmission on puppy202 didn't recognize magnet URL schemes. The next hurdle was to find a way to convert magnet URLs to .torrent files. Here I turned to Google and found the following link which allowed just that. So I converted a test URL to a torrent and tried to do the download. The sample I used was converted to the following torrent file.
I don't remember the result nor the attempts to get this to work.

However in all my searches I couldn't find software compatible with puppy202 so I decided to continue with puppy4.1.2 and I found all the software I wanted off the shelf (kind of).


I also found this site which provided me options to download pet files for transmission. I had earlier tried to installing transmission downloaded from Barry's page here. This worked but was a version of transmission that didn't work with magnet URLs. The former site's 4th download had everything statically linked or so I thought. There was a dependency missing, viz., libfio-2.0.so which I found here. But I continued to still get errors as described here but I realized I could still run transmission in the CLI mode using the following commands
  1. transmission-cli or transmission-daemon
  2. transmission-remote
  3. Using the web browser once transmission is started by going to http://localhost:9091/transmission
But my final hurdle still needed to be crossed, viz., setting up an SSH server to access the system remotely. I left this for last thinking it would be easy since I'd seen a few entries about setting up an sshd server on puppy. And it was relatively simple when I found this link. Thanks to Sven, install and everything was running. Needless to say, I changed the default passwords for both root & spot and I was able to ssh into my puppy server.

With that I was almost at the end of my journey. Unfortunately, the journey never ends. I found that X forwarding on the ssh server wouldn't work and there was no way to login to the 'console' of puppy. I also wanted to get LILO setup on puppy so I could get rid of the PCQuest installation. Alternatively I need to get grub installed. So my setup continues...

For VNC and viewing the console I used X11VNC which I found here. (Plain  old vnc is available from here but does not work on the display 0, i.e., the main console). Installing server and client was simple enough. Started x11vncServer from the menu, and chose to start it every time the system boots up. Then few more screens (enter vncserver password, etc.) and it was all started.
From another system (my laptop) I tried to connect vncviewer to the :5900 but that failed. That's because I only allow ssh through my firewall. So, I now connected to the puppy PC using ssh and local forwarding (-L5900:localhost:5900) to enable connecting to the system's console (screen 0 in VNC). That freed me up quite a bit and I could administer the system remotely.

Finally I also forwarded the transmission web port (-L9091:localhost:9091) to enable access the transmission web interface remotely. I also created a symlink to /root/.config/tranmission-cli as /root/.config/transmission-daemon which allowed me to start a download using transmission-cli and then continue using transmission-daemon.

And finally to get everything started up automatically on a reboot I wrote a small script and invoked it /etc/rc.d/rc.local. rc.local made a call to the script startTransmission.sh which contains the following lines of code:

  # Starts the transmission daemon
  transmission-daemon
  # Verifies already downloaded files for the first torrent in the list
  transmission-remote -t 1 -v &
  # Gets file# as I don't have enough space to download the full torrent
  transmission-remote -t 1 -g 1,5,6,7,8,9,10

With that my project came to an end. Will append and update this blog post if I think of anything later.

Update:
One more useful link to remember is this one which helps to autostart GUI applicaitons on different desktops. If I ever need it this will be good to remember.

Update:
While searching for alternatives to allow a central file server, I found this link which claims to be a tool to remotely login into puppy. I've not tried it out, but it maybe a useful one to try

Tuesday, January 22, 2013

Installing/Upgrading to Fedora 18

Finally found some time on the weekend and got one of the systems at home upgraded to Fedora 18. And it happened to be a long overdue upgrade considering the previous version was Fedora 12.

I was expecting a simple upgrade and it was that. Quick, simple and relatively easy.

But there were a few bits of customization I had to do. I'm using the rest of this post to document the things I discovered and did
  1. Quite obviously all the games I had installed on this had to be re-installed. And I had to copy across a number of repositories for yum too.
    1. Adobe repository for flash player
    2.  rpm fusion for all the non-free stuff
    3. plex repository for plex media server to stream multimedia to my TV
  2. The installation didn't allow me to choose my hostname and domain so I got stuck with localhost.localdomain. Changing it required me to use the command hostnamectl which made it permanent across reboots. Source: http://docs.fedoraproject.org/en-US/Fedora/18/html/Release_Notes/sect-Release_Notes-Changes_for_Sysadmin.html
  3. On another system I wanted to run Preupgrade.But FC18 has stopped support. Instead you have to use a tool called fedup. More details here: https://fedoraproject.org/wiki/FedUp. Some useful hints for update also available at https://fedoraproject.org/wiki/Upgrading_Fedora_using_yum
  4. Plexmediaserver refused to work. Looking over the logs I realized that SE was preventing rsync from writing into the plugins directory. So, I had to add a policy to allow this using a few commands one of which was audit2allow. However this command wasn't installed by default in FC18 and I had to install it using yum install /usr/bin/audit2allow. Source: http://danwalsh.livejournal.com/61710.html
  5. To get Plexmedia to work finally I had to run the following commands:
    1. grep  rsync /var/log/audit/audit.log | audit2allow -m mypol
    2. semodule -i mypol.pp
    3. systemctl stop plex
    4. cd /var/lib/plexmediaserver/Library/Application Support
    5. rm -rf Plex\ Media\ Server
    6. systemctl start plex
    7. systemctl status plex
    8. The above command highlights any errors. I saw a lot of failures with rsync and hence started fiddling around with the SE Linux policies.
    9. I had to repeat the commands about 6 times and it still didn't work
    10. Finally, I gave up and disabled SELinux. (in /etc/sysconfig/selinux) I'm sure there is another way but I was running out of time and patience.
    11. Rebooted and plex started up. So its confirmed that SE Linux was preventing rsync.
  6. Good links on plex adminsitration
    1. http://wiki.plexapp.com/index.php/PlexNine_PMS_TipsTricks#Linux
    2. http://wiki.plexapp.com/index.php/PMS
    3. http://wiki.plexapp.com/index.php/PlexNine_PMS_TipsTricks#Plex_Media_Server_Tips 
  7. With that success I then tried to upgrade another existing FC17 system using Fedora Update, aka fedup, to upgrade the second system to FC18.
    1. This command line utility is simple too:
      1. fedup --network 18 --debuglog fedupdebug.log
    2. This was for a network update, i.e., the latest versions of the packages I had installed were downloaded and then once I rebooted there was an option to Upgrade.
    3. The only issue I faced was that I kept getting a no host found error when downloading the package perl-ExtUtils-ParseXS-3.16-235.fc18.noarch.rpm.
    4. Finally I had to copy this off the ISO I had downloaded to use for the fresh install on the first system.
    5. Once that hurdle was crossed the remaining packages were downloaded and the upgrade was smooth.
    6. I'm now blogging this using the upgraded FC-18.
    7. One weird issue I'm facing right now is in the browser (Opera) when writing this blog, after typing about 3-4 characters, the cursor moves to the start of the line, types a j and then starts typing normally for the next 3-4 characters.
      1. I'm hoping this is some temporary issue and a reboot resolves it.
      2. If not, I'll update this post with the details.