Best I've found so far:
http://www.vim.org/scripts/script.php?script_id=1326
Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts
Thursday, 10 June 2010
Wednesday, 5 May 2010
Installing Fedora 12 on an IBM / Lenovo Thinkpad X60s / X60
Having blasted my X60s and nearly pulled all my own hair out here is a recipe to do this. It is really rather straight-forward, and will leave your Windows in tact.
1. Grab your 4gb memory key and insert into a Windows box. If you have an x60 and no external drive you really you should have one of these: [ put it on your keyring! ]
2. Grab this from a Windows box: http://sourceforge.net/projects/unetbootin/
3. Select Fedora, Live and then OK.
4. When done, insert into your X60 and boot.
5. When logged in select "install to harddrive".
Job done!
1. Grab your 4gb memory key and insert into a Windows box. If you have an x60 and no external drive you really you should have one of these: [ put it on your keyring! ]
2. Grab this from a Windows box: http://sourceforge.net/projects/unetbootin/
3. Select Fedora, Live and then OK.
4. When done, insert into your X60 and boot.
5. When logged in select "install to harddrive".
Job done!
Friday, 2 April 2010
Monday, 15 February 2010
Upgrading Centos 5.3 to 5.4
yum clean all yum update glibc\* yum update yum\* rpm\* python\* yum clean all yum update shutdown -r now
Wednesday, 3 February 2010
RHCE Cramming Cheat Sheet
This week I'm taking the RHCE Fast track course. I have some Linux experience, but I am basically winging it. Others on the course had taken Red Hat's advised course of taking the RHCT first, which substantially shares a lot of content. First two days they were moaning we were covering old ground.
The key is knowing the commands associated with each learning objectice, I think. As then its possible to lookup the man page if unsure about the syntax. This seems like a great cheatsheet, for that purpose, for cramming:
http://conigliaro.org/wiki/rhce
http://conigliaro.org/wiki/rhce?do=export_html version to view from my phone :P
Test is on Friday coming...
The key is knowing the commands associated with each learning objectice, I think. As then its possible to lookup the man page if unsure about the syntax. This seems like a great cheatsheet, for that purpose, for cramming:
http://conigliaro.org/wiki/rhce
http://conigliaro.org/wiki/rhce?do=export_html version to view from my phone :P
Test is on Friday coming...
Saturday, 16 January 2010
Android Development Environment on Ubuntu
I bought a Nexus One Google phone. Some day I thought I'd play around with the development possibilities, and in an idle moment last night, I wondered how hard it would be to get a "hello world" going.
I started with my laptop running Ubuntu 9.10, my Google phone and the USB cable to connect the two together.
http://developer.android.com/sdk/index.html
Step one is to download the SDK. The link is indicated above. I just downloaded the Linux version and decompressed it into a folder under my user directory I set aside for Android stuff. I edited my ~/.bash.rc to add the tools directory to the path as they recommended also (see link below).
http://developer.android.com/sdk/installing.html#Installing
Next step was to install the ADT, which is an IDE based on Eclipse with all kinds of niceties for developing and compiling Android apps. Think of it like Visual Studio for Android. First step is to install the base version of Eclipse, so I can then add ADT as a plugin. So to begin, from the terminal:
sudo apt-get install eclipse
After that installs (over 200mb) I started up Eclipse (installs a link under "Programming" in the Gnome menu bar, which I moved to the desktop where I like my icons). As an aside I understand version 3.5.1 of Eclipse is required by the ADT, however by co-incidence this is the version which is installed by default in Ubuntu 9.10 when you apt-get eclipse. So those using another distro or version may need additional steps to ensure the correct version of Eclipse.
I then followed the steps below to install the ADT into Eclipse, basically going to help > install software and adding the URL Google provide for the ADT, and next, next finishing.
http://developer.android.com/sdk/eclipse-adt.html#installing
However there was one "gotcha", in that some third party libraries could not be found. I found the answer in a mailing list post (second link below) - basically I needed to add the Eclipse update site to the install of Eclipse - so the ADT can pull in some third party libraries. This allowed me to complete the ADT installation, which by the way took about 20 mins.
http://groups.google.com/group/android-developers/browse_thread/thread/1da899d34557f2e8
The final step in setting the ADT up is to associate the SDK with the ADT install. This is done by going into window > preferences in Eclipse, and on the Android page pointing at the location where the SDK is installed.
So, having downloaded the SDK, decompressed it, installed eclipse, installed the ADT into Eclipse and pointing it at the SDK I was ready to go? Not quite - Google have different version of the Android OS, and provide different modules for each. The Nexus One is Android 2.1, or API level 7. Frankly I don't really care about older versions, so I was just interested in the 2.1 SDK. I therefore followed these steps to install the 2.1 SDK:
http://developer.android.com/sdk/adding-components.html#InstallingComponents
All that being complete I followed the documentation to write a "hello world application".
http://developer.android.com/guide/tutorials/hello-world.html
As indicated in the tutorial, as a first step I ran the app on the emulator which I created as part of the tutorial. But really I was interested in seeing the application on my phone. The steps for that were here:
http://developer.android.com/guide/developing/device.html
Again the Google documentation was excellent - however one Gotcha on Ubuntu was the adb server needs to be run as root, otherwise you see an access denies message. This can be done by starting the server as follows:
sudo /path/to/sdk/tools/adb start-server
And that was it! I had the "Hello world" on my phone. We were watching Raiders of the Lost ark in the background while I was tinkling on my laptop, and as a guide I started this when Ballac takes the statue off Jones in the Andes, and was completely finished by the time Jones miraculously arrives at the submarine base towards the end.
I started with my laptop running Ubuntu 9.10, my Google phone and the USB cable to connect the two together.
http://developer.android.com/sdk/index.html
Step one is to download the SDK. The link is indicated above. I just downloaded the Linux version and decompressed it into a folder under my user directory I set aside for Android stuff. I edited my ~/.bash.rc to add the tools directory to the path as they recommended also (see link below).
http://developer.android.com/sdk/installing.html#Installing
Next step was to install the ADT, which is an IDE based on Eclipse with all kinds of niceties for developing and compiling Android apps. Think of it like Visual Studio for Android. First step is to install the base version of Eclipse, so I can then add ADT as a plugin. So to begin, from the terminal:
sudo apt-get install eclipse
After that installs (over 200mb) I started up Eclipse (installs a link under "Programming" in the Gnome menu bar, which I moved to the desktop where I like my icons). As an aside I understand version 3.5.1 of Eclipse is required by the ADT, however by co-incidence this is the version which is installed by default in Ubuntu 9.10 when you apt-get eclipse. So those using another distro or version may need additional steps to ensure the correct version of Eclipse.
I then followed the steps below to install the ADT into Eclipse, basically going to help > install software and adding the URL Google provide for the ADT, and next, next finishing.
http://developer.android.com/sdk/eclipse-adt.html#installing
However there was one "gotcha", in that some third party libraries could not be found. I found the answer in a mailing list post (second link below) - basically I needed to add the Eclipse update site to the install of Eclipse - so the ADT can pull in some third party libraries. This allowed me to complete the ADT installation, which by the way took about 20 mins.
http://groups.google.com/group/android-developers/browse_thread/thread/1da899d34557f2e8
The final step in setting the ADT up is to associate the SDK with the ADT install. This is done by going into window > preferences in Eclipse, and on the Android page pointing at the location where the SDK is installed.
So, having downloaded the SDK, decompressed it, installed eclipse, installed the ADT into Eclipse and pointing it at the SDK I was ready to go? Not quite - Google have different version of the Android OS, and provide different modules for each. The Nexus One is Android 2.1, or API level 7. Frankly I don't really care about older versions, so I was just interested in the 2.1 SDK. I therefore followed these steps to install the 2.1 SDK:
http://developer.android.com/sdk/adding-components.html#InstallingComponents
All that being complete I followed the documentation to write a "hello world application".
http://developer.android.com/guide/tutorials/hello-world.html
As indicated in the tutorial, as a first step I ran the app on the emulator which I created as part of the tutorial. But really I was interested in seeing the application on my phone. The steps for that were here:
http://developer.android.com/guide/developing/device.html
Again the Google documentation was excellent - however one Gotcha on Ubuntu was the adb server needs to be run as root, otherwise you see an access denies message. This can be done by starting the server as follows:
sudo /path/to/sdk/tools/adb start-server
And that was it! I had the "Hello world" on my phone. We were watching Raiders of the Lost ark in the background while I was tinkling on my laptop, and as a guide I started this when Ballac takes the statue off Jones in the Andes, and was completely finished by the time Jones miraculously arrives at the submarine base towards the end.
Wednesday, 23 December 2009
Show only directories in bash using ls
In Windows you can just go "dir /ad" on Linux its not so obvious:
ls -d */
ls -d */
Friday, 18 December 2009
BitchX
mkdir BitchX
cd BitchX
wget http://www.bitchx.com/download/BitchX-1.1-final-linux.tar.gz
tar xvf BitchX*.tar.gz
./BitchX
http://linuxreviews.org/software/irc/bitchx/
cd BitchX
wget http://www.bitchx.com/download/BitchX-1.1-final-linux.tar.gz
tar xvf BitchX*.tar.gz
./BitchX
http://linuxreviews.org/software/irc/bitchx/
Saturday, 5 December 2009
Linux on the Desktop : Ubuntu Karmic
Linux is the server operating system, but honestly I wouldn't consider it on the desktop - except for development. I've installed Ubuntu Karmic on my Thinkpad X60s as a dual boot with XP for one reason - as a platform for developing an Django application. The deployment issues I had with my last application, a Rails project, developing on XP then migrating to Linux (especially with Imaging libraries) was unreal - so I'd prefer to develop on the same platform the application will run in production.
My first instinct was to run CENTOS, the same platform as my host, however I stumbled across the ChromiumOS build page and it was clear Google developers were using Ubuntu Karmic, so I thought, if its good enough for them, I'll try it. Honestly I'm very impressed, it was actually a slick experience. I run Windows 7 on my desktop at work and on my Media PC, and the experience isn't better (and of course the compatibility isn't there on Ubuntu, however for developing a Django web app, in Vi and using all the nice Python deployment tools Ubuntu is ideal.
Basic stuff, but this article helped me get the default GUI how I wanted it:
http://www.techotopia.com/index.php/Customizing_the_Ubuntu_GNOME_Desktop_Panels
My first instinct was to run CENTOS, the same platform as my host, however I stumbled across the ChromiumOS build page and it was clear Google developers were using Ubuntu Karmic, so I thought, if its good enough for them, I'll try it. Honestly I'm very impressed, it was actually a slick experience. I run Windows 7 on my desktop at work and on my Media PC, and the experience isn't better (and of course the compatibility isn't there on Ubuntu, however for developing a Django web app, in Vi and using all the nice Python deployment tools Ubuntu is ideal.
Basic stuff, but this article helped me get the default GUI how I wanted it:
http://www.techotopia.com/index.php/Customizing_the_Ubuntu_GNOME_Desktop_Panels
Tuesday, 3 November 2009
Keyboard shortcuts in BASH on RHEL / Centos
- Ctrl + R - Let’s you search through previously used commands
- Ctrl + K - Clear the line after the cursor
- Tab - Auto-complete files and folder names
Restarting Apache in CENTOS / RHEL
/sbin/service httpd restart
May work without the /sbin/ depending on the path.
Monday, 2 November 2009
Automated Rails Website Clone / Mirror with WGet and FTP script.
As a bit of paid work outside of my day job I wrote a css layout for someone's business website. It was just a product presentation site. Eventually I was being asked to update it all the time so I wrote a rails app to allow stuff to be added by the customer in a 'wiki' style manner: [http://code.google.com/p/rapid-space/].
At first I had this served from my host, but it was a bit slow and occasionally my host had issues. So I've moved the rails app onto another domain, and each week I'm looking to configure a copy process to mirror the rails site, then FTP it up to my customer's own public host.
Clone locally
First step is to clone the site generated from the rails app into a static folder on my host, which is running CENTOS. I did this using wget:
First step is to clone the site generated from the rails app into a static folder on my host, which is running CENTOS. I did this using wget:
- [root@host ~]# wget --mirror -w 2 -p --convert-links -P foldertocopy2 http://rooturltomirror/
Given the scale of this site, there is no benefit to leaving the asset timestamps feature switched on, so I turned it off as follows ... in /config/environment.rb add:
- ENV['RAILS_ASSET_ID'] = ''
Finally, I was missing files which were linked to via the CSS file, i.e. via @import url("importthis.css"); or images which are only referenced by the css file. Given these files are not subject to change, I'm going to overwrite them from a static folder when I upload to the public host- I can use the same mechanism to blank out the forms (which won't work on a static host).
FTP to the public domain.
I just tried to use the ftp client built into CENTOS for this, and echo the commands into it via the EOF mechanism in a shell script, per: http://www.cyberciti.biz/faq/linux-unix-autologin-cron-ftp-script/
However, using the standard ftp command you can't recurse through directories. I.e. you can copy all files in a directory, but not descend into sub directories. First I looked at a scripted option such as: http://expect.nist.gov/example/rftp . This approach made me nervous so I upgraded to lftp on my host ... [yum install lftp], and found I could upload the site as follows (with the command 'mirror -R'):
- [root@host ~]# lftp public-host-ftp-server -u ftpusername, ftppassword -e "mirror -R /local/source /remote/destination"
Subscribe to:
Posts (Atom)