Thursday, 28 August 2008

Removing line feed characters from dos files for use in UNIX

Here are a couple of commands to remove line feeds from files created in windows for use in UNIX.
I had a list of usernames in a csv which I wanted to run an ldap search on however the line feed characters were causing this to mess up the command

To get around this you can either run

dos2unix current.csv newfile.csv

or you can open the text file in vi. The text file looked like this

johnhe02^M
paulke04^M
marymc04^M
elainp02^M
jimfor01^M
markad01^M
johnmc12^M


then basically open up your command prompt by pressing the colon key ":", and enter the following

%s/^M//g

Note to get the ^M character you hold down ctrl and press V and then M (V and M must be pressed while holding down ctrl)

Another way to acheive the same results as dos2unix is by using the flip command. Thanks to Jadu Kumar Saikia for pointing this out :o)

Wednesday, 2 July 2008

Online FTP client and file editor

The online ftp client, http://www.net2ftp.com/, I have been using for a while, to get around my works firewall and update my website is for some reason inaccessible. For anyone looking for an alternative, http://www.web2ftp.com/ is quite nice. I used to use it previously, and then the host shut it down due to misuse, which was the reason I started using net2ftp in the first place. It is not as feature rich as net2ftp, but it does what it says on the tin.

UPDATE (3rd July '08)
I tried to log in to web2ftp this morning and got the following error.

Web2FTP deactivated !!!Sorry, but we had to deactivate our free service Web2FTP.We have introduced new security functions as logging User actions, Ip-Numbers and blocking whole IP-Ranges from Asian and African networks, but some users continued to upload Phishing sites. We are working on a new solution for registered user.Leverkusen, 03.07.2008

Saturday, 21 June 2008

Setting up jUploadr for ubuntu

jUploadr is a nice little java application which allows you to upload photos to flickr, zooomr and any other photo sharing site you are a member of which allows api access. When you read the FAQs for linux, which are virtually non existent, it basically says that you have to run the application by typing the following into the command line.

./jUploader

This is a touch on the crappy side as many users may not be confident enough with command line working, It also means that you need to remember where you stored to directory and run cd to change to that directory.

It's much easier to add the application to the top panel and here's how you do it.
  • Download jUploadr for linux
  • Once you have extracted the contents of the tar file to your desktop, enter the following into your command line.
sudo mv jUploadr-1.1.2-linuxGTK-i386 /usr/bin/jUploadr-1.1.2-linuxGTK-i386

  • Note that jUploadr-1.1.2-linuxGTK-i386 should be changed to whatever the version you have is called. Run ls on your Desktop to find out and allow an easy copy and paste.
  • Right click on the top panel and select "add to panel"
  • Select "Custom Application Launcher"
  • The main bit here is to browse to the file "jUploadr" within the directory you just moved to /usr/bin.
  • Click on the little spring platform image and this lets you select the icon to chose. Navigate to the directory you just moved to /usr/bin and click open, you then have the choice of 3 image files to select.
  • There you go. Just click and this will open jUploadr.

Friday, 6 June 2008

Nominate Ubuntu for SourceForge's OSS award

SourceForge are holding their annual Community Choice Awards for open source software. I have nominated Ubuntu Linux. If you want to nominate Ubuntu as well, click the link below.



You can view last years winners and nominees here, http://sourceforge.net/community/cca07.

Thursday, 5 June 2008

Gmail displaying annoying error about full cache

When I upgraded to Internet Explorer 7, on Windows XP SP2, I started getting an error on gmail which says

Your browser's cache is full and may interfere with your Google Mail experience.

Since clearing my cache did not help in the slightest so I tried a few other things.


  • Tools > Internet Options > Advanced tab. make sure that “Do not save encrypted pages to disk” is unchecked.
  • Tools > Internet Options > Browsing History Settings, Change “Check for newer version of pages at every visit” to "automatically". This originally worked for me but then something happened on my laptop and then it started again.
  • The size of my cache was sitting at 1024MB so I lowered this to 250MB. (From Browsing History Settings again)
  • The final thing I tried ended up getting rid of the error. I added mail.google.com to the list of allowed sites.
  • Somewhere advised that deleting your temp Internet files and recreating it might help but I didn't try this, nor can I advise if it works.

If anyone has anything else that can be added please leave a comment and I'll add it in.

UPDATE: The message came back after adding mail.google.com to my list of allowed pop ups. After further rooting around I found that if you access gmail through https://mail.google.com/ using secure http the message disappears. As far as I'm aware you still need to go into your internet options on explorer and ensure that “Do not save encrypted pages to disk” is unchecked.

This poses a problem if you access your gmail through google toolbar however, google allows you to edit the xml behind the custom buttons such as gmail. Here's what you have to do in order to get your gmail button on your google toolbar pointing to https://mail.google.com/.

  • Click the settings button on your toolbar.
  • Click on "Custom Buttons"
  • Find the gmail option and click "Edit"
  • Click "Advanced"
  • Press ctrl + f and search for http://mail.google/ and change all instances to https://. There should be 3 urls you need to change.
  • If you like, you can change the message you get which tells you that you have new gmail. Search for or just and between the tags, put something like, "Hey bawbag! Check your email."

You can also do this "advanced edit" in forefox's google toolbar, however firefox doesn't cause gmail the confusion that internet explorer does.

UPDATE (again) - gmail now offers you the option under "settings", to always use https. Tick this option and this whole problem goes away which is good because the iGoogle gadget still takes you to the http: site.

Tuesday, 27 May 2008

Dogpile search gadget for iGoogle

While comparing Google with Dogpile I discovered that there was no dogpile search gadget for iGoogle so I created one.

Use this button to add the uk dogpile search gadget to your iGoogle page


Use this button to add the dot com version of dogpile to your iGoogle page.


Enjoy

Find out where spam came from using Gmail

When registering for an account on any online service it's always best to check the site's privacy policy to see what a site will do, or will not do, with the details you provide.

Personally I can't be arsed with all that fannying around so I just fire in my details and hope my spam filter is up for the challenge, and to be honest, Gmail's spam filter is very good. A way in which you can find sort this out is to sign up with your email address as username+sitename@gmail.com. So if I was a wary customer signing up for Blogger, I would enter mine as graham.macleod+blogger@gmail.com.

You can even have these filtered accordingly, by going into Gmail and select Settings, then Filters and Create a new filter. Add in the address which you signed up with into the To field, and on the next step select Apply the label and then create a new label, I.e. Blogger.

If any spam comes in, you can view which email address it was sent to and therefor tell which site's admin's balls you can go and break. Make sure you don't select Delete it at step 2 of the filter making process as you will still want to receive authentic emails from that site.

This doesn't always work and sites with more advanced registration processes may not accept it. It can't hurt though, unless you have had to enter a mountain of personal info and because an error was detected, you have to start again. But in that case, the website is shit and you should think twice about registering in the first place.