Posts Tagged Linux
If you want to make use of the EXIF data stored in a JPEG (.jpg or .jpeg) or TIFF (.tif or .tiff) file from the command line in Ubuntu Linux — or most other Linux variants — here’s how.
This was tested on Ubuntu 11.10 (Oneiric Ocelot).
First, you will need to have imagemagick installed to provide the identify command.
sudo apt-get install imagemagick
Next, you can retrieve the data on an image with the following example:
identify -verbose /usr/share/backgrounds/WildWheat_by_Brian_Burt.jpg
If you want just the EXIF data, you can use something like the following:
identify -verbose /usr/share/backgrounds/WildWheat_by_Brian_Burt.jpg | grep "exif:"
DD-WRT is feature-rich alternative firmware for a large number of home router models. It adds a wonderful array of new features, VPN being one of them. This walkthrough will show you how to quickly and easily configure a PPTP VPN server on your DD-WRT-powered router, so you can connect to your home network from afar, create a secure tunnel so you can safely use a public Wifi point with your laptop, or secure your iOS or Android device.
Setting up the VPN Server
So here’s how to get started. First, you’ll need a build of DD-WRT supported by your router which includes the VPN software. If you’re doing this on an Internet connection which has an IP address that changes periodically (i.e. residential), you’ll likely want a Free DynDNS hostname to point to your IP address. You’ll also need a basic familiarity of networking.
For the remainder of this guide, I will assume your router’s internal (LAN) IP address is 192.168.1.1.
Start by going to http://192.168.1.1 and login to your router’s administration panel.
Go to Services > VPN and set PPTP Server to enable. After doing that, a few new options will appear. The only ones you need to set are Server IP, Client IP(s), and CHAP Secrets. Set them as follows:
Server IP: You can set this to your router’s LAN IP, i.e.
Client IPs: Set this to an IP range OUTSIDE your DHCP range (See Setup > Basic Setup to figure your DHCP range) A good example value would be
192.168.1.200-250 for clients to receive addresses within that range.
CHAP Secrets: This is the username/password combinations for your VPN clients. Format is:
myname * mypassword *
Neither the username nor password can contain spaces, and must be all-lowercase.
You’re done with this page; Click Apply Settings.
Now go to Security > VPN Passthrough and make sure PPTP is set to Enabled. Click Apply Settings if you had to change the setting.
You should now be able to connect to your VPN using your Windows, Mac, or Linux computer by setting up a PPTP connection to your public (WAN) IP or hostname.
Can’t get connected? First, try setting up your connection to the router itself, using the LAN IP (192.168.1.1). If that works, then the VPN server is set up correctly; the problem is likely on the WAN side. Keep reading for suggestions. If you weren’t able to get connected, go back to the top and double-check your settings.
You may need to make the following settings adjustment if you are having trouble connecting specifically from your iOS device running iOS 4.3 or above. Go to Administration > Commands and paste the following in the box. Click Save Startup.
#!/bin/sh echo "nopcomp" >> /tmp/pptpd/options.pptpd echo "noaccomp" >> /tmp/pptpd/options.pptpd kill `ps | grep pptp | cut -d ' ' -f 1` pptpd -c /tmp/pptpd/pptpd.conf -o /tmp/pptpd/options.pptpd
(Source: DD-WRT Wiki)
If you can connect from the LAN side, but are still having trouble connecting from the WAN side, it’s likely your ISP or your gateway device (modem) is blocking the needed GRE protocol or the needed PPTP port or traffic. Contact your ISP for further assistance.
Do you have any experience or tips to share regarding VPN connections to a DD-WRT-powered router, or any suggestions in addition to the above? Please feel free to share them in the comments below. Thank you!
If you — like me — take a lot of digital pictures, you probably have a hundred folders full of images on your hard drive or external drives, and not nearly as sorted as you would like them to be. you have probably gotten to the point that you don’t know what’s in them or can’t find an image when you’re looking. I had around 10,000 images in over a dozen folders spanning 5+ years, and I had no intention of even trying to sort them manually :) So I wrote this script.
The following script was written in bash on Ubuntu Linux and automatically sorts your images into directories based on the date and time the photo was taken. How does it do this? By making use of the EXIF data your digital camera stores inside the image. The date and time the photo was taken is stored in that EXIF data. When an image doesn’t have EXIF data (such as when it was downloaded from the Internet, or taken from a camera that doesn’t support adding EXIF data), it will use the files last-modified time.
First, this should be run in the top-most directory of wherever your pictures are stored. If you have pictures/foldername/somepics/ and pictures/anotherfolder/morepics, run it from your pictures/ directory.
There are quite a few opportunities to improve this script — and some cautionary notes as well — marked within the script with FIXME tags. I’m already finished sorting my images, but anyone is welcome to contribute suggestions and improvements, which I’ll look into incorporating the next time I’m using this. You are welcome to include any suggestions or code improvements in the comments below using <code> and/or <pre> tags.
Usage: Copy the script into a file, editing options where appropriate, and save it. Make it executable and run it from the command line or window, from the directory where your pictures are stored. No command-line arguments. Back up your stuff first :)
UPDATE: Because WordPress keeps mangling this code, it has been moved to github, here.
Questions, comments, or feedback can be left in the comments below, or please use the contact form. Thank you!
I ran into a scan a document to send it via email. PDF format would have been preferable, but Windows Scan and Fax wouldn’t export as a PDF. Fortunately OpenOffice is quite capable of converting a multi-page document to a PDF, and does it quite easily. I had already scanned my documents, so I wanted something that would work with the existing scans. Side note: OpenOffice also works on Linux.
Here’s how I did it.
Scan your pages into JPG files and save them where you can find them. In this example, I have four scanned JPG files which I want to convert into a single PDF.
Start OpenOffice Writer
Click Insert > Picture > From File
Select the image to insert. Repeat with any additional images you wish to insert. Once you have all your images inserted, go to…
Click File > Export as PDF.
Set the PDF export options. If you aren’t sure what to do here, accept the defaults as they are fine. Click Export and you’ll be prompted to give the file a name and save it.
Google and Apple each brought their own services which allow users to upload their music library and stream it to their devices in the form of Google Music and iTunes Match, respectively. But how do those services compare?
Let’s take a side-by-side comparative look at some of the features:
|Feature||Google Music||iTunes Match|
|Number of songs||20,000 songs not purchased from Android Market||25,000 songs not purchased from iTunes|
|Supported devices||Works on common browsers on Win / Mac / Linux / Android / iOS (1)||Works on Win / Mac running iTunes; iOS devices supporting iCloud|
|Sync||Automatically sync music to Google Music using Win / Mac / Linux client||Automatically sync music to iTunes Match using iTunes|
|Sync Selection||Select which songs to upload using sync client||All songs from iTunes library are synchronized.|
|Local Storage||Save music to your Win / Mac / Linux / Android device for offline playback||Save music to your Win / Mac / iOS device for offline playback|
|Uploading||Every song must be uploaded||Matching is performed prior to upload; Only unmatched songs are uploaded|
|Supported file formats||Mp3, AAC (m4a), wma, flac, ogg (source)||Same as iTunes|
|Excluded formats||None||24-bit audio; Bitrates under 96 kbps; File over 200MB (source)|
(1) Although Google Music is reported to work on iOS devices,
As you can see, Google Music is aimed at the Android crowd, while iTunes Match is aimed at the iOS crowd. However, a few of the major points in Google Music’s favor that I see are that it supports playback from a web browser, has a Linux client, and is free.
I’m interested in everyone else’s opinion as well. Which streaming music service do you prefer, and why? Please feel free to share your opinion in the comments below. Thank you!
How to display ICE (In Case of Emergency) contact on your iPhone, Android, or BlackBerry lock screen
If you have stored ICE (In Case of Emergency) contacts in your phone, you probably noticed that your phone treats them like any other contact. This means that emergency responders won’t be able to access your contacts if your phone is locked. Also, if you’re an Android user using a custom ROM, there’s a chance an emergency responder won’t even know how to access your contacts. In an emergency, every moment is important.
You can, through a few easy steps, display emergency contact information, along with any other information you select, on your phone’s lock screen. This means that it will be available just by turning on the screen, making it quickly and easily available in the case of a real emergency. Who knows, this might actually help you get your device back in case it’s lost or stolen.
You might also be interested in reading about how to streamline your emergency contacts with an emergency email address.
So how to do it?
Select a wallpaper (dimensions)
Start by selecting what will be your new wallpaper (either an existing photo or graphic) with a resolution close to your phone’s display, to prevent the text from being stretched or scaled. Here’s the resolution of many popular smartphone displays:
- BlackBerry: Varies by model, but the most common sizes are:
- BlackBerry Bold: 480×320
- BlackBerry Curve: 320×240
- BlackBerry Pearl: 240×260
- For other devices, or to verify the above, see BlackBerry forums for your device’s exact resolution.
- Android: Android also supports a wide variety of screen resolutions. You will likely find your device and its resolution listed at Comparison of Android devices – Wikipedia.
- iPhone 2G through 3GS: 320×480
- iPhone 4 and 4S (retina display): 640×960
Edit it to add your contact information
Open your soon-to-be wallpaper in your favorite image editor, or use one of the following utilities:
You’ll want to place your text and/or information where the UI isn’t going to cover it. Here’s some pointers:
- BlackBerry: Avoid the top 1/4 and bottom 1/4 of the image, as well as the direct center (where the unlock/password prompt appears).
- Android: Avoid the top 1/4 and bottom 1/4 of the image, as well as any other UI elements (such as the unlock slider). You may have to experiment somewhat, since different Android versions have different slide-to-unlock methods.
- iPhones: avoid the top 1/4 and bottom 1/4 of the image.
Save it to your phone
- BlackBerry: Either insert your microSD card to your computer, or connect your phone and mount it as USB storage. Copy your picture to your card in any location, but remember where you put it for the next step.
- Android: Either insert your microSD card to your computer, or connect your phone and mount it as USB storage. Copy your picture to your card in any location, but remember where you put it for the next step.
- iPhone: The easiest way to get your picture onto your device is to email it to an account you have set up on your phone. Then, from your phone, save the attachment from your email.
Set it as your wallpaper
- BlackBerry: open your pictures (via Media, may vary by OS version), display the image you want, hit menu > Set as Home Screen image.
- Android: From your home screen, press menu button > Wallpapers > Gallery > (select folder and file).
- iPhone: Go to Settings > Wallpaper > (touch screen) > Camera Roll > (Select your picture) > Set.
There you have it. Your emergency contact information is now displayed on your phone’s display, even when it is locked, making it available to emergency personnel quickly and easily.
What do you think of this tip? Was this useful to you? Do you have any other tips or suggestions to share related to this? Please share in the comments section below! Thank you!
I’ve been getting more than a few expressions of “You? Got an iPhone?” from friends and family lately, after they see my iPhone 4S. While I’ve been known not to be the biggest fan of Apple up until now, I’m starting to realize why the device has gotten to be so popular — it’s an easy-to-use, reliable device that doesn’t frustrate.
Although learning a new smartphone OS hasn’t been terribly difficult, here’s some of the major points between the two that I’ve found myself having to adjust to.
The Home Screen
The home screen on an Android phone is more-or-less a “blank slate”, waiting for you to fill it to your liking with widgets and shortcuts, to make it just the way you want it. If you want to access all your installed apps you open what’s typically referred to as the “app drawer.”
On an iPhone, that “app drawer” is your home screen. No widgets here, though apps do have what’s called “badges” that can show an indicator on the icon if the app has something that wants your attention, such as a number of missed calls over the phone icon, unread texts over the messages icon, and so on.
Android-based phones feature a microSD card slot for removable storage. It’s an optional — but highly recommended — additional storage space that you can use for media, and on some versions of Android, even apps. You can upgrade this by simply popping out the card, copying the contents to a new, presumably larger card, and putting that card in your phone.
On an iPhone on the other hand, what you buy is what you get — buy a 16GB iPhone, get a gross total of 16GB. Likewise for the other sizes, such as 32GB.
However, there’s some distinct differences:
Android phones by default have their apps installed on the phone’s lower-capacity internal memory. Since the internal memory is smaller than the microSD card, (Sprint’s Epic 4G for example, only has 1GB internal memory), you are sharply limited for the space your apps have to share with everything else. Starting with Android version 2.2 (Froyo) and up you had the ability to move apps to the SD card. This frees up internal memory. However, its up to the app developer to support this feature, and if they did, most apps still required that you move it yourself from within the phone’s settings. Remember those widgets? Don’t plan on them working if you move your app to the SD card.
iPhones on the other hand have a single unified storage area for everything. Assuming you get a 16GB iPhone, that storage space is used for everything — there’s no need to move anything. Apps, media, and the OS all share a single storage space. You might say “this is less overall than an Android phone”, and you would be right. But — you aren’t going to have to try to balance what apps are stored on SD card versus the phone’s internal memory.
When you plug your Android-based smartphone into your computer’s USB port, you’ll likely get a message asking if you want to charge-only, or mount as removable storage. If you select to mount as removable storage you have full access to the SD card in the phone. This is handy if you want to use your phone’s memory card as a makeshift USB flash drive. However, once you mount it to the PC, you don’t have access to it from the phone. Apps that are installed on the SD card cannot be run, and you won’t have access to any media on the card until you unmount it from the PC.
Installing media on an Android phone isn’t difficult. Simply mount the phone to your PC as USB storage (or insert the microSD card into your computer), and copy music, pictures, or anything else you like to it. When you unmount (or insert the card back into the phone) the media scanner will automatically detect your media and propagate the media libraries. But — it’s up to you to get your own music.
With an iPhone and a Windows or Mac computer running iTunes you simply connect your phone to your PC, select what media — such as music, movies, or other — you want to sync, and iTunes adds it to your device. You can purchase your music through iTunes as well. However, you have to use iTunes. Don’t expect your iPhone and Linux-based PC to get along very well.
Backup and Restore
With an iPhone, completely backing up your device is as quick and easy as plugging it into iTunes and right-clicking on it and choosing “Backup.” iTunes takes care of it, and makes restoring it just as painless.
With an stock Android, you don’t have any options to make a “full” backup. You can sync your contacts, calendar, etc to your Google (or other) account, and there they will sit in case you need them. In case of a serious issue, you can boot your phone to recovery mode and wipe it from there, restoring it to stock configuration, after which, prepare to spend some time reinstalling and reconfiguring your apps and account. Rooted users have a few additional options, such as ClockworkMod’s Nandroid backup and restore, and the third party app Titanium Backup.
There’s a lot more differences between the two that I didn’t cover above. But I will say this: When people ask me why I got an iPhone, my typical response is something along the lines of “it’s easy to use without having to think about.” I really enjoy my iPhone, and I don’t think I’ll be picking up an Android phone again anytime soon.
What about you, reader? What are you experiences with Android and iPhones? Do you have anything to share or compare that I didn’t cover in the above? Please feel free to share your thoughts in the comments below!
To do this, CTRL-ALT-F1 to an open terminal, log in, and run:
xinit ./program -- :1
where program is the program file you want to start in a new X session. Assuming your normal X session is on
:0 and appears when you CTRL-ALT-F7, your new one will spawn on CTRL-ALT-F8.
Questions, comments? Please feel free to leave them in the comments section below. Thank you.
If you’re lucky enough to have a broadband card that works under Linux, your plan probably includes an “allowance” or data usage quota per month. You might be thinking how nice it would be to have a utility that tracks your data usage for the month (or other period) and gives you an easy-to-read report. You might also want said monitoring utility to have pre-built packages for Ubuntu / Debian.
NTM (Network Traffic Monitor) is what you want. As of this post the latest version is NTM 1.2.4.
Start by going to the NTM download site and downloading ntm-1.2.4.deb. Then double-click on it to install it using Ubuntu Software Center.
Once installed, you will find NTM at Applications > Internet.
Upon starting, it minimizes to the tray (next to the clock). You can open the interface by left-clicking the icon, and open the menu to access preferences by right-clicking the icon.
By default NTM monitors
ppp0, which is the most likely interface that your broadband card will use. If you want to monitor a different interface, change that under the General tab. If you’re not sure what interface to use, run the following command:
This lists all interfaces and will help you locate your desired connection by IP / MAC and other info.
Also by default, NTM is configured with some other settings, such as auto-disconnecting after a data threshold has been reached (98MB by default), and disconnecting after a certain number of usage hours (30). These are likely too low for most mobile broadband users. Be sure to change these settings, under the Traffic, Time Slot, and Time tabs, to prevent unexpected disconnections.
Questions, comments, or other feedback? Please comment below. Thanks!
When you run the Windows checkdisk (chkdsk) utility, it may report the disk being in use and recommend that you schedule chkdsk to run the next time the computer restarts, like the following screenshot shows:
Windows can’t check the disk while it’s in use. Do you want to check for hard disk errors the next time you start your computer?
However, doing that ran me into a very curious issue on Michele’s laptop: I would restart the computer, and get a message telling me to press any key within a few seconds to abort the scan if I so desired. Sorry, but I don’t have the exact message in front of me at the moment. Curiously it would abort itself after a second or two, stating that I pressed a key (which I did not). I’m fairly certain this is caused by this issue here: kernel atkbd.c: Unknown key released messages on Linux.
In order to make the chkdsk run without aborting due to that phantom keystroke, you have to set the delay to zero. To do this, boot back up into Windows, open an administrative-level command prompt, and run the following:
That will set the delay to zero seconds, effectively making it unable to be interrupted. Schedule the disk check again and reboot. It should run without issue.
Questions, comment, or any issues with the above are welcome in the comments section. Thank you!