Search
Thursday, 11 February 2010
Download a website using WGET on Linux
wget --wait=20 --limit-rate=20K -r -p -U Mozilla http://asite.com
Tuesday, 9 February 2010
Noatime and atime attribute on Linux
Linux records information about when files were created and last modified as well as when it was last accessed. There is a cost associated with recording the last access time. The ext2 file system of Linux has an attribute that allows the super-user to mark individual files such that their last access time is not recorded. This may lead to significant performance improvements on often accessed frequently changing files such as the contents of the /var/spool/news directory.
Linux has a special mount option for file systems called noatime that can be added to each line that addresses one file system in the /etc/fstab file.
If a file system has been mounted with this option, reading accesses to the file system will no longer result in an update to the atime information associated with the file like we have explained above.
The importance of the noatime setting is that it eliminates the need by the system to make writes to the file system for files which are simply being read.
Since writes can be somewhat expensive, this can result in measurable performance gains. Note that the write time information to a file will continue to be updated anytime the file is written to.
In our example below, we will set the noatime option to our /chroot file system.
Edit the fstab file vi /etc/fstab and add in the line that refer to /chrootfile system the noatime option after the defaults option as show below:
/dev/sda7 /chroot ext2 defaults,noatime 1 2
You need not reboot your system for the change to take effect, just make the Linux system aware about the modification you have made to the /etc/fstab file. This can be accomplished with the following commands:
/#mount -oremount /chroot/
Monday, 8 February 2010
Using Winaudit to audit PC's to SQL Database
- Download the Winaudit application from http://www.pxserver.com/WinAudit.htm
- Setup a SQL DB for audits
- Create a windows user who has 'write' rights
- copy winaudit folder and application into root of c drive
- create odbc connect (on pc to be audited) to sql db using designated windows user
- create winaudit script and schedule as follows and save to root winaudit folder, then schedule auto-run of this script
winaudit /r=report /o=ODBC /f=ODBC connector name /u=user /p=password
r=gsoPxuTUeERNtnzDaIbMpmidcSArCHGBLJF
Server: SQL Server name
DB: Database Name
Friday, 5 February 2010
Changing WIndows NIC binding order - Win Serv 2008
If an additional NIC is added to a Windows server the binding order will change. This may stop services like Documentum from functioning. To change the Adapter order in Windows Server 2008:
Control Panel
Network and Sharing Center
(left hand pane) – Manage Network Connections
(on toolbar for window) Advanced > Advanced Settings
On the Adapters and Bindings Tab the order of the NIC’s can be changed. Make any data IP NIC’s top of the list, iSCSI and others further down the list
Tuesday, 2 February 2010
Gobbler's Knob
Bad news from Gobbler's Knob. Punxsutawney Phil saw his shadow so it's six more weeks of winter...
Linux - split and rejoin large files
In Linux it is possible to split big files, say ISO's into smaller, user defined chunks. For example, to split a 5Gb ISO into 250Mb chunks, open a bash terminal and type:
split -b250m filename.ISO iso-split
When run the filename>ISO file is split into 250 MegaByte chunks and iso-split is prefix of generated file(s).
To restore the file(s) back into one chunk type:
cat iso-split* > NEWFILENAME
If you need to rejoin the file in windows then go to a command prompt and type:
type filepart1 filepart2 > filefull
Where filepart1, 2 etc are the chunks made by the linux split command
split -b250m filename.ISO iso-split
When run the filename>ISO file is split into 250 MegaByte chunks and iso-split is prefix of generated file(s).
To restore the file(s) back into one chunk type:
cat iso-split* > NEWFILENAME
If you need to rejoin the file in windows then go to a command prompt and type:
type filepart1 filepart2 > filefull
Where filepart1, 2 etc are the chunks made by the linux split command
Friday, 22 January 2010
Linux - Run multiple commands together
Just create your script or from command line put && between commands. This logical operator 'and' will run the first command, then if successful will run the second. If the first fails the command chain will stop. i.e.
./configure && make && make install
The other logical operator available is || this means 'or' for example, run a script and if it fails print a warning, i.e.
./some_script || echo "The script isn't working!"
./configure && make && make install
The other logical operator available is || this means 'or' for example, run a script and if it fails print a warning, i.e.
./some_script || echo "The script isn't working!"
Linux - export system info
Just open up a terminal and do the following:
uname -a >system.txt
lspci >>system.txt
lspci -vv >>system.txt
uname -a >system.txt
lspci >>system.txt
lspci -vv >>system.txt
Tuesday, 5 January 2010
Convert AAC or M4A to MP3 format
Seeing as I don't like Apple much, I had some music that needed converting. My old friend Linux Mint was used again.
for i in *.m4a; do
echo "Converting: ${i%.m4a}.mp3"
faad -o - "$i" | lame - "${i%.m4a}.mp3"
done
- Just fire up Synaptic and add the Lame and FAAD packages
- Create a new shell script with the following text:
for i in *.m4a; do
echo "Converting: ${i%.m4a}.mp3"
faad -o - "$i" | lame - "${i%.m4a}.mp3"
done
- save the script as mp42mp3
- copy the file to the /bin/ folder and make it executable (you will need to sudo)
- Open a terminal window in the folder you wish to convert M4A's and type m4a2mp3 and the script will convert all the files to MP3
Tuesday, 3 November 2009
Windows 7
OK, hate to admit it but I actually quite like Windows 7! Been running the RTM since August and am quite impressed. Not sure what they have done between this and Vista to speed it up but it works.
Customising and window effects are still better with Compiz but for Windows it seems good. Even runs on relatively crappy hardware.
Not so impressed with the XP virtual machine though, quite slow and for end users more hassle than it is worth!
Also been trying the new MS anti-virus package, MS Security Essentials, which for a freebie doesn't seem too bad, should be an OK alternative to AVG free, AVAST etc.
http://www.microsoft.com/Security_Essentials/
Customising and window effects are still better with Compiz but for Windows it seems good. Even runs on relatively crappy hardware.
Not so impressed with the XP virtual machine though, quite slow and for end users more hassle than it is worth!
Also been trying the new MS anti-virus package, MS Security Essentials, which for a freebie doesn't seem too bad, should be an OK alternative to AVG free, AVAST etc.
http://www.microsoft.com/Security_Essentials/
ImageMagick
Been using this lately, you sometimes forgot just how quick and powerful linux command line utils are.
http://www.imagemagick.org/script/convert.php
http://www.imagemagick.org/script/convert.php
Subscribe to:
Posts (Atom)