Linux Media Center Edition
Controls everything from your TV to your security system using anything from your cell phone to a Wii remote. More >>>
Articles, tips, tricks, and techniques.
Controls everything from your TV to your security system using anything from your cell phone to a Wii remote. More >>>
Posted by Tony at 1:29 PM 5 comments
ISPs and authorities increasingly use Deep Packet Inspection hardware to block access to BitTorrent sites, or spy on users ’ browsing habits. To offer its users more privacy, isoHunt has now added SSL encryption, making it impossible for your ISP or the authorities to monitor your activities on the BitTorrent site. More >>>>
Posted by Tony at 4:46 PM 0 comments
Firefox 3 — available for download at 10am PDT Tuesday — is the culmination of a two-year quest to build the best browser ever. And while it’s not perfect, it comes pretty close.
The open-source web browser is the fastest and most secure version of Firefox yet. Significant improvements have been made to the way it uses your computer’s resources, so the memory leaks and other performance problems found in Firefox 2 have been stamped out. Text and image rendering have also been improved, and the underlying code for Gecko, the engine that draws the actual web pages on the screen, has been updated. There are also heaps of useful features that have been added for both power users and newcomers alike.
Posted by Tony at 5:19 PM 0 comments
REMOVE VISTA .com how to uninstall Windows Vista | ||
Please note that this site is just a helping hand. Use this information at your own risk! | ||
Please select your situation: | ||
I installed Vista next to another Windows version (e.g. XP/98 etc.) | I upgraded from XP to Vista | I've only got Vista installed on my system |
Posted by Tony at 10:51 AM 0 comments
ACP-Hyperactive Swapmeet at 1310 Edinger, Santa Ana CA. (Off the 55 Freeway and Edinger). Come by and see the latest in HDTV HDMI, DVI, + Component Cables and computer cables, adapters accessories such as USB to SATA, CAT5e, USB Adapters, & DB9-Pin Serial Cables for those free-to-air boxes. The latest USB to RS232 just came in and they do work with anything!
Posted by Tony at 9:44 PM 83 comments
Spencer is the inventor of Asterisk, a free software program that establishes phone calls over the Internet. handles voicemail, caller ID, teleconferencing and other features for the phone.a decent-size company can rip out its traditional phone switch, even some of its newfangled Internet telephone gear, and say good-bye to 80% of its telecom costs More >>>
Posted by Tony at 7:33 PM 0 comments
Automatically Defragment C: Daily
schtasks /create /tn "Defrag C" /tr "defrag c: /f" /sc daily /st 23:00:00 /ru "System"
This will set your computer to automatically perform a complete defrag of the C: drive each day at 11:00:00 PM (23:00:00). It does this by creating a scheduled task called Defrag C. It will run this command under the computer’s system account.
---------------------------------------
Map A Drive Letter to a Folder
subst W: C:\Windows
Sometimes, your directory structure can get pretty deep and complicated. You can simplify this a bit by mapping a drive letter to commonly used folders. In the example that I have given, this will create a drive letter W: and map it to the C:\Windows directory. Then, whenever you go into My Computer, you will see a W: drive and when you browse to it, it will automatically take you to the contents of the C:\Windows folder.
You can do this with any unused drive letter and any folder that exists on your system.
-------------------------------------------
List All Tasks Running On The Computer
tasklist
It’s always good to know what is running on your system. This is the command line version of the processes tab in Taks Manager.
Kill A Program
taskkill /im programname.exe /f
If, when using the tasklist command, you discover that there is something running you just want killed. This is the way to do it! Just note the program name and use it in place of programname.exe.
--------------------------------------------
Reboot a Remote Computer
shutdown -r -f -m \\remotePC -c "System will be rebooted in 20 seconds"
Sometimes, you just need to reboot a system. This will do it remotely and give the user a 20 second warning.
---------------------------------------------
stopping and starting the print spooler
%windir%\System32\cmd.exe /c "net.exe stop Spooler && net start Spooler"
--------------------------------------------
To flush the DNS lookup cache (in case you’re using a dynamic DNS service for connecting to a remote machine etc.):
ipconfig /flushdns
If you’re using IIS for local web development and you need to restart the web server (to clear the application data, to fix a DLL problem etc.), don’t take the long trip through Control Panel -> Administrative Tools -> Internet Information Services etc. Simply issue:
iisreset
------------------------------------------------
runas /user:domain\user “cmd.exe /c shutdown -r -f -m 192.168.0.2 -t 1″
if you also supply the password it will not prompt
------------------------------------------------
Posted by Tony at 3:52 PM 1 comments
Now you can explore the universe without Google earth... >>>
Posted by Tony at 4:07 PM 0 comments
The ultimate collection of cheat sheets for linux users. Enough to fill up your whole wall with commands yielded by the geek gods! Be sure to digg this so more people can have the opportunity to get ahold of all these in one place. More >>>
Posted by Tony at 9:10 AM 0 comments
Whether you've got a home network, small network, enterprise network or anything in between, these 10 freebies can make it more secure, run better and easier to manage. They're useful, easy to learn ... and you certainly can't beat free
1. NetworkMagic
2. Spiceworks IT Desktop
3. NetLimiter Monitor
4. Network Notepad
5. Advanced Net Tools (ANT)
6. DreamSys Server Monitor
7. NetBrute Scanner
8. Technitium MAC Address Changer
9. RogueScanner
10. NetPeek More >>>
Posted by Tony at 6:10 PM 0 comments
An up to date list of the top 100 Apple Mac applications. These are the applications that every Mac should be installed with. Examples include the free to the not so free but all worth having for any Mac user.
1) AppFresh
Software updater is great for Apple applications, but appfresh has the ability to check thrid party apps for updates. A great little tool for keeping upto date.
2) AppZapper
Although applications are easy to uninstall on a mac there are usually small preference files hanging about. Appzapper cleans up an uninstall all of those files.
3) Disk Inventory X
A simple program that scans your disk and visually shows what files takes up how much space, good to visualise if you are running out of space and you have some size hogs.
4) Grand Perspective
Very similar to Disk Inventory X, shows you what files take up how much space on your website.
5) OpenPlist
A very cool little tool if you need to end up editing Plist files.
6) Quicksilver
One of the best applications ever made for the mac. Its a quick launch tool that enables you to open and do practically anything. Very fun and really increases your productivity.
7) Stuffit
An application design to unstuff or unpack nearly any file. Create if you use archives a lot.
8) TextWrangler
A very cool text editor that lets you edit text files quickly. Sometimes more powerful than text edit.
9) TidyUp
An application that enables you to search through a list of files finds duplicates. Great if you have many files and you need to organise them.
10) Todos
Leaves no application behind. A very visual way to view all of the applications on your computer. Kind of surpassed by the stacks in the dock.
11) UnRarX
UnrarX gives you the abilty to easily uncompress .rar files. Very good, although stuffit can now handle .rar files.
12) Xslimmer
Give your mac a diet. It goes through and removes the powerpc or intel parts of your program. It can really reduce the size of applications. Can also break them if you are not careful.
More >>>
Posted by Tony at 10:53 PM 0 comments
Basic movie ripping is fairly simple. Here's how to do it:
Posted by Tony at 11:51 PM 0 comments
Well with the June 30th cutoff fast approaching, PC World decided to take a look at your options for procuring an XP license after that date, but unfortunately, the picture isn't too pretty.
The problem with vista is that it looks great, but is a pain in the butt to do most things with. Security is not in creating extra steps for the user to jump through, security is taking those steps in the background without the user needing to worry about it. when you have to disable things like User control to make the OS less annoying, you've added a level of security that is in fact, useless.
Having said that, Vista is not near as bad as it's made out to be, and by that XP 2009 cut off, it will likely really shine. But Microsoft needs to take a serious look at why XP was so popular, and Vista so resisted. And they need to take notes from the Mac side of things and not wait years between massive updates. You spend 6+ years with one OS, of course you are going to be comfortable with it and resist change. More >>>
Posted by Tony at 11:42 PM 0 comments
1. Character Map = charmap.exe (very useful for finding unusual characters)
2. Disk Cleanup = cleanmgr.exe
3. Clipboard Viewer = clipbrd.exe (views contents of Windows clipboard)
4. Dr Watson = drwtsn32.exe (Troubleshooting tool)
5. DirectX diagnosis = dxdiag.exe (Diagnose & test DirectX, video & sound cards)
6. Private character editor = eudcedit.exe (allows creation or modification of characters)
7. IExpress Wizard = iexpress.exe (Create self-extracting self-installing package)
8. Mcft Synchronization Manager = mobsync.exe (appears to allow synchronization of files on the network for when working offline. Apparently undocumented).
9. Windows Media Player 5.1 = mplay32.exe (Retro version of Media Player, very basic).
10. ODBC Data Source Administrator = odbcad32.exe (something to do with databases)
11. Object Packager = packager.exe (to do with packaging objects for insertion in files, appears to have comprehensive help files).
12. System Monitor = perfmon.exe (very useful, highly configurable tool, tells you everything you ever wanted to know about any aspect of PC performance, for uber-geeks only )
13. Program Manager = progman.exe (Legacy Windows 3.x desktop shell).
14. Remote Access phone book = rasphone.exe (documentation is virtually non-existant).
15. Registry Editor = regedt32.exe [also regedit.exe] (for hacking the Windows Registry).
16. Network shared folder wizard = shrpubw.exe (creates shared folders on network).
17. File siganture verification tool = sigverif.exe
18. Volume Contro = sndvol32.exe (I've included this for those people that lose it from the System Notification area).
19. System Configuration Editor = sysedit.exe (modify System.ini & Win.ini just like in Win98! ).
20. Syskey = syskey.exe (Secures XP Account database - use with care, it's virtually undocumented but it appears to encrypt all passwords, I'm not sure of the full implications).
21. Mcft Telnet Client = telnet.exe
22. Driver Verifier Manager = verifier.exe (seems to be a utility for monitoring the actions of drivers, might be useful for people having driver problems. Undocumented).
23. Windows for Workgroups Chat = winchat.exe (appears to be an old NT utility to allow chat sessions over a LAN, help files available).
24. System configuration = msconfig.exe (can use to control starup programs)
25. gpedit.msc used to manage group policies, and permissionsr
Posted by Tony at 10:26 PM 0 comments
Run Commands:
http://www
Posted by Tony at 10:19 PM 0 comments
Didn't see that one coming. Blog contains details to what this could mean for both companies. May as well be one of the most important takeovers of 2008 already! More >>>
Posted by Tony at 9:21 AM 0 comments
arch | show architecture of machine |
uname -r | show used kernel version |
dmidecode -q | show hardware system components - (SMBIOS / DMI) |
hdaparm -i /dev/hda | displays the characteristics of a hard-disk |
hdparm -tT /dev/sda | perform test reading on a hard-disk |
cat /proc/cpuinfo | show information CPU info |
cat /proc/interrupts | show interrupts |
cat /proc/meminfo | verify memory use |
cat /proc/swaps | show file(s) swap |
cat /proc/version | show version of the kernel |
cat /proc/net/dev | visualizzare gli adattori di rete See adattori network |
cat /proc/mounts | show mounted file system(s) |
lspci -tv | display PCI devices |
lsusb -tv | show USB devices |
date | show system date |
cal 2007 | show the timetable of 2007 |
date 041217002007.00 | set date and time - MonthDayhoursMinutesYear.Secondi |
clock -w | save changes on BIOS |
| |
Shutdown, Restart of a system and Logout | |
shutdown -h now | shutdown system |
shutdown -r hours:minutes & | planned shutdown of the system |
shutdown -c | cancel a planned shutdown of the system |
shutdown -r now | reboot |
reboot | reboot |
logout | leaving session |
| |
Files and Directory | |
cd /home | enter to directory '/ home' |
cd .. | go back one level |
cd ../.. | go back two levels |
cd | go to home directory |
cd ~utente | go to home directory |
cd - | go to previous directory |
pwd | show the path of work directory |
ls | view files of directory |
ls -F | view files of directory |
ls -l | show details of files and directory |
ls -a | show hidden files |
ls *[0-9]* | show files and directory containing numbers |
lstree | show files and directories in a tree starting from root |
mkdir dir1 | create a directory called 'dir1' |
mkdir dir1 dir2 | create two directories simultaneously |
mkdir -p /tmp/dir1/dir2 | create a directory tree |
rm -f file1 | delete file called 'file1' |
rm -rf dir1 | delete directory called 'dir1' |
rm -rf dir1 dir2 | delete two directories simultaneously |
mv dir1 new_dir | rename / move a file or directory |
cp file1 file2 | copying a file |
cp dir/* . | copy all files of a directory within the current work directory |
cp -a /tmp/dir1 . | copy a directory within the current work directory |
cp -a dir1 dir2 | copy a directory |
ln -s file1 lnk1 | create a symbolic link to file or directory |
ln file1 lnk1 | create a physical link to file or directory |
touch -t 0712250000 fileditest | modify timestamp of a file or directory - (YYMMDDhhmm) |
| |
File search | |
find / -name file1 | search file and directory into root filesystem from '/' |
find / -user user1 | search files and directories belonging to 'user1' |
find /home/user1 -name *.bin | search files with '. bin' extension within directory '/ home/user1' |
find /usr/bin -type f -atime +100 | search bynary files are not used in the last 100 days |
find /usr/bin -type f -mtime -10 | search files created or changed within 10 days |
find / -name *.rpm -exec chmod 755 {} ; | search files with '.rpm' extension and modify permits |
find / -name *.rpm -xdev | search files with '.rpm' extension ignoring removable partitions as cdrom, pen-drive, etc.… |
locate *.ps | find files with the '.ps' extension - first run 'updatedb' command |
whereis halt | show location of a binary file, source or man |
which halt | show full path to a binary / executable |
| |
Mounting a Filesystem | |
mount /dev/hda2 /mnt/hda2 | mount disk called hda2 - verify existence of the directory '/ mnt/hda2' |
umount /dev/hda2 | unmount disk called hda2 - exit from mount point '/ mnt/hda2' first |
fuser -km /mnt/hda2 | force umount when the device is busy |
umount -n /mnt/hda2 | run umount without writing the file /etc/mtab - useful when the file is read-only or the hard disk is full |
mount /dev/fd0 /mnt/floppy | mount a floppy disk |
mount /dev/cdrom /mnt/cdrom | mount a cdrom / dvdrom |
mount /dev/hdc /mnt/cdrecorder | mount a cdrw / dvdrom |
mount /dev/hdb /mnt/cdrecorder | mount a cdrw / dvdrom |
mount -o loop file.iso /mnt/cdrom | mount a file or iso image |
mount -t vfat /dev/hda5 /mnt/hda5 | mount a Windows FAT32 file system |
mount /dev/sda1 /mnt/usbdisk | mount a usb pen-drive or flash-drive |
mount -t smbfs -o username=user,password=pass //winclient/share /mnt/share | mount a windows network share |
| |
Disk Space | |
df -h | show list of partitions mounted |
ls -lSr |more | show size of the files and directories ordered by size |
du -sh dir1 | estimate space used by directory 'dir1' |
du -sh * | sort -rn | show size of the files and directories sorted by size |
rpm -q -a --qf '%10{SIZE}\t%{NAME}\n' | sort -k1,1n | show space used by rpm packages installed sorted by size (fedora, redhat and sourced) |
dpkg-query -W -f='${Installed-Size;10}\t${Package}\n' | sort -k1,1n | show space used by deb packages installed sorted by size (ubuntu, debian and deriviate) |
| |
Users and Groups | |
groupadd group_name | create a new group |
groupdel group_name | delete a group |
groupmod -n new_group_name old_group_name | rename a group |
useradd -c "Nome Cognome" -g admin -d /home/user1 -s /bin/bash user1 | create a new user belongs "admin" group |
useradd user1 | create a new user |
userdel -r user1 | delete a user ( '-r' eliminates home directory) |
usermod -c "User FTP" -g system -d /ftp/user1 -s /bin/nologin user1 | change user attributes |
passwd | change password |
passwd user1 | change a user password (only by root) |
chage -E 2005-12-31 user1 | set deadline for user password |
pwck | check correct syntax and file format of '/etc/passwd' and users existence |
grpck | check correct syntax and file format of '/etc/group' and groups existence |
alias hh='history' | set an alias for a command - hh = history |
| |
Permits on File - use "+" to set permissions and "-" to remove | |
ls -lh | show permits |
ls /tmp | pr -T5 -W$COLUMNS | divide terminal into 5 columns |
chmod ugo+rwx directory1 | set permissions reading (r), write (w) and (x) access to users owner (u) group (g) and others (o) |
chmod go-rwx directory1 | remove permits reading (r), write (w) and (x) access to users group (g) and others (or |
chown user1 file1 | change owner of a file |
chown user1 -R directory1 | change user owner of a directory and all the files and directories contained inside |
chgrp gruppo1 file1 | change group of files |
chown user1:gruppo1 file1 | change user and group ownership of a file |
find / -perm -u+s | view all files on the system with SUID configured |
chmod u+s /bin/file_eseguibile | set SUID bit on a binary file - the user that running that file gets same privileges as owner |
chmod u-s /bin/file_binario | disable SUID bit on a binary file |
chmod g+s /home/public | set SGID bit on a directory - similar to SUID but for directory |
chmod g-s /home/public | disable SGID bit on a directory |
chmod o+t /home/comune | set STIKY bit on a directory - allows files deletion only to legitimate owners |
chmod o-t /home/comune | disable STIKY bit on a directory |
| |
Special Attributes on file - use "+" to set permissions and "-" to remove | |
chattr +a file1 | allows write opening of a file only append mode |
chattr +c file1 | allows that a file is compressed / decompressed automatically by the kernel |
chattr +d file1 | makes sure that the program ignores Dump the files during backup |
chattr +i file1 | makes it an immutable file, which can not be removed, altered, renamed or linked |
chattr +s file1 | allows a file to be deleted safely |
chattr +S file1 | makes sure that if a file is modified changes are written in synchronous mode as with sync |
chattr +u file1 | allows you to recover the contents of a file even if it is canceled |
lsattr | show specials attributes |
| |
Archives and compressed files | |
bunzip2 file1.bz2 | decompress a file called 'file1.bz2' |
bzip2 file1 | compress a file called 'file1' |
gunzip file1.gz | decompress a file called 'file1.gz' |
gzip file1 | compress a file called 'file1' |
gzip -9 file1 | compress with maximum compression |
rar a file1.rar test_file | create an archive rar called 'file1.rar' |
rar a file1.rar file1 file2 dir1 | compress 'file1', 'file2' and 'dir1' simultaneously |
rar x file1.rar | decompress rar archive |
unrar x file1.rar | decompress rar archive |
tar -cvf archive.tar file1 | create a uncompressed tarball |
tar -cvf archive.tar file1 file2 dir1 | create an archive containing 'file1', 'file2' and 'dir1' |
tar -tf archive.tar | show contents of an archive |
tar -xvf archive.tar | extract a tarball |
tar -xvf archive.tar -C /tmp | extract a tarball into / tmp |
tar -cvfj archive.tar.bz2 dir1 | create a tarball compressed into bzip2 |
tar -xvfj archive.tar.bz2 | decompress a compressed tar archive in bzip2 |
tar -cvfz archive.tar.gz dir1 | create a tarball compressed into gzip |
tar -xvfz archive.tar.gz | decompress a compressed tar archive in gzip |
zip file1.zip file1 | create an archive compressed in zip |
zip -r file1.zip file1 file2 dir1 | compress in zip several files and directories simultaneously |
unzip file1.zip | decompress a zip archive |
| |
RPM Packages - Fedora, Red Hat and like | |
rpm -ivh package.rpm | install a rpm package |
rpm -ivh --nodeeps package.rpm | install a rpm package ignoring dependencies requests |
rpm -U package.rpm | upgrade a rpm package without changing configuration files |
rpm -F package.rpm | upgrade a rpm package only if it is already installed |
rpm -e package_name.rpm | remove a rpm package |
rpm -qa | show all rpm packages installed on the system |
rpm -qa | grep httpd | show all rpm packages with the name "httpd" |
rpm -qi package_name | obtain information on a specific package installed |
rpm -qg "System Environment/Daemons" | show rpm packages of a group software |
rpm -ql package_name | show list of files provided by a rpm package installed |
rpm -qc package_name | show list of configuration files provided by a rpm package installed |
rpm -q package_name --whatrequires | show list of dependencies required for a rpm packet |
rpm -q package_name --whatprovides | show capability provided by a rpm package |
rpm -q package_name --scripts | show scripts started during installation / removal |
rpm -q package_name --changelog | show history of revisions of a rpm package |
rpm -qf /etc/httpd/conf/httpd.conf | verify which rpm package belongs to a given file |
rpm -qp package.rpm -l | show list of files provided by a rpm package not yet installed |
rpm --import /media/cdrom/RPM-GPG-KEY | import public-key digital signature |
rpm --checksig package.rpm | verify the integrity of a rpm package |
rpm -qa gpg-pubkey | verify integrity of all rpm packages installed |
rpm -V package_name | check file size, permissions, type, owner, group, MD5 checksum and last modification |
rpm -Va | check all rpm packages installed on the system - use with caution |
rpm -Vp package.rpm | verify a rpm package not yet installed |
rpm2cpio package.rpm | cpio --extract --make-directories *bin* | extract executable file from a rpm package |
rpm -ivh /usr/src/redhat/RPMS/`arch`/package.rpm | install a package built from a rpm source |
rpmbuild --rebuild package_name.src.rpm | build a rpm package from a rpm source |
| |
YUM packages updater - Fedora, RedHat and like | |
yum install package_name | download and install a rpm package |
yum update | update all rpm packages installed on the system |
yum update package_name | upgrade a rpm package |
yum remove package_name | remove a rpm package |
yum list | list all packages installed on the system |
yum search package_name | find a package on rpm repository |
yum clean packages | clean up rpm cache erasing downloaded packages |
yum clean headers | remove all files headers that the system uses to resolve dependency |
yum clean all | remove from the cache packages and headers files |
| |
DEB packages - Debian, Ubuntu and like | |
dpkg -i package.deb | install / upgrade a deb package |
dpkg -r package_name | remove a deb package from the system |
dpkg -l | show all deb packages installed on the system |
dpkg -l | grep httpd | show all rpm packages with the name "httpd" |
dpkg -s package_name | obtain information on a specific package installed on system |
dpkg -L package_name | show list of files provided by a package installed on system |
dpkg --contents package.deb | show list of files provided by a package not yet installed |
dpkg -S /bin/ping | verify which package belongs to a given file |
APT packages updater - Debian, Ubuntu e like | |
apt-get install package_name | install / upgrade a deb package |
apt-cdrom install package_name | install / upgrade a deb package from cdrom |
apt-get update | update all deb packages installed on system |
apt-get remove package_name | remove a deb package from system |
apt-get check | verify correct resolution of dependencies |
apt-get clean | clean up cache from packages downloaded |
| |
View file content | |
cat file1 | view the contents of a file starting from the first row |
tac file1 | view the contents of a file starting from the last line |
more file1 | view content of a file along |
less file1 | similar to 'more' command but which allows backward movement in the file as well as forward movement |
head -2 file1 | view first two lines of a file |
tail -2 file1 | view last two lines of a file |
tail -f /var/log/messages | view in real time what is added to a file |
| |
Text Manipulation | |
cat file_test | [operation: sed, grep, awk, grep, etc] > result.txt | syntax to elaborate the text of a file, and write result to a new file |
cat file_originale | [operazione: sed, grep, awk, grep, etc] >> result.txt | syntax to elaborate the text of a file and append result in existing file |
grep Aug /var/log/messages | look up words "Aug" on file '/var/log/messages' |
grep ^Aug /var/log/messages | look up words that begin with "Aug" on file '/var/log/messages' |
grep [0-9] /var/log/messages | select from file '/var/log/messages' all lines that contain numbers |
grep Aug -R /var/log/* | search string "Aug" at directory '/var/log' and below |
grep Aug /var/log/messages | write result of a search within a file |
sed 's/stringa1/stringa2/g' example.txt | replace "string1" with "string2" in example.txt |
sed '/^$/d' example.txt | remove all blank lines from example.txt |
sed '/ *#/d; /^ *$/d' example.txt | remove comments and blank lines from example.txt |
echo 'esempio' | tr '[:lower:]' '[:upper:]' | convert from lower case in upper case |
sed -e '1d' result.txt | eliminates the first line from file example.txt |
sed -n '/stringa1/p' | view only lines that contain the word "string1" |
sed -e 's/ *$//' example.txt | remove empty characters at the end of each row |
sed -e 's/stringa1//g' example.txt | remove only the word "string1" from text and leave intact all |
sed -n '1,5p;5q' example.txt | view from 1th to 5th row |
sed -n '5p;5q' example.txt | view row number 5 |
sed -e 's/00*/0/g' example.txt | replace more zeros with a single zero |
cat -n file1 | number row of a file |
cat example.txt | awk 'NR%2==1' | remove all even lines from example.txt |
echo a b c | awk '{print $1}' | view the first column of a line |
echo a b c | awk '{print $1,$3}' | view the first and third column of a line |
paste file1 file2 | merging contents of two files for columns |
paste -d '+' file1 file2 | merging contents of two files for columns with '+' delimiter on the center |
sort file1 file2 | sort contents of two files |
sort file1 file2 | uniq | sort contents of two files omitting lines repeated |
sort file1 file2 | uniq -u | sort contents of two files by viewing only unique line |
sort file1 file2 | uniq -d | sort contents of two files by viewing only duplicate line |
comm -1 file1 file2 | compare contents of two files by deleting only unique lines from 'file1' |
comm -2 file1 file2 | compare contents of two files by deleting only unique lines from 'file2' |
comm -3 file1 file2 | compare contents of two files by deleting only the lines that appear on both files |
| |
Character set and Format file conversion | |
dos2unix filedos.txt fileunix.txt | convert a text file format from MSDOS to UNIX |
unix2dos fileunix.txt filedos.txt | convert a text file format from UNIX to MSDOS |
recode ..HTML <> page.html | convert a text file to html |
recode -l | more | show all available formats conversion |
| |
Filesystem Analisys | |
badblocks -v /dev/hda1 | check bad blocks in disk hda1 |
fsck /dev/hda1 | repair / check integrity of linux filesystem on disk hda1 |
fsck.ext2 /dev/hda1 | repair / check integrity of ext2 filesystem on disk hda1 |
e2fsck /dev/hda1 | repair / check integrity of ext2 filesystem on disk hda1 |
e2fsck -j /dev/hda1 | repair / check integrity of ext3 filesystem on disk hda1 |
fsck.ext3 /dev/hda1 | repair / check integrity of ext3 filesystem on disk hda1 |
fsck.vfat /dev/hda1 | repair / check integrity of fat filesystem on disk hda1 |
fsck.msdos /dev/hda1 | repair / check integrity of dos filesystem on disk hda1 |
dosfsck /dev/hda1 | repair / check integrity of dos filesystems on disk hda1 |
| |
Format a Filesystem | |
mkfs /dev/hda1 | create a filesystem type linux on hda1 partition |
mke2fs /dev/hda1 | create a filesystem type linux ext2 on hda1 partition |
mke2fs -j /dev/hda1 | create a filesystem type linux ext3 (journal) on hda1 partition |
mkfs -t vfat 32 -F /dev/hda1 | create a FAT32 filesystem |
fdformat -n /dev/fd0 | format a floppy disk |
mkswap /dev/hda3 | create a swap filesystem |
| |
SWAP filesystem | |
mkswap /dev/hda3 | create a swap filesystem |
swapon /dev/hda3 | activating a new swap partition |
swapon /dev/hda2 /dev/hdb3 | activate two swap partitions |
| |
Backup | |
dump -0aj -f /tmp/home0.bak /home | make a full backup of directory '/home' |
dump -1aj -f /tmp/home0.bak /home | make a incremental backup of directory '/home' |
restore -if /tmp/home0.bak | restoring a backup interactively |
rsync -rogpav --delete /home /tmp | synchronization between directories |
rsync -rogpav -e ssh --delete /home ip_address:/tmp | rsync via SSH tunnel |
rsync -az -e ssh --delete ip_addr:/home/public /home/local | synchronize a local directory with a remote directory via ssh and compression |
rsync -az -e ssh --delete /home/local ip_addr:/home/public | synchronize a remote directory with a local directory via ssh and compression |
dd bs=1M if=/dev/hda | gzip | ssh user@ip_addr 'dd of=hda.gz' | make a backup of a local hard disk on remote host via ssh |
tar -Puf backup.tar /home/user | make a incremental backup of directory '/home/user' |
( cd /tmp/local/ && tar c . ) | ssh -C user@ip_addr 'cd /home/share/ && tar x -p' | copy content of a directory on remote directory via ssh |
( tar c /home ) | ssh -C user@ip_addr 'cd /home/backup-home && tar x -p' | copy a local directory on remote directory via ssh |
tar cf - . | (cd /tmp/backup ; tar xf - ) | local copy preserving permits and links from a directory to another |
find /home/user1 -name '*.txt' | xargs cp -av --target-directory=/home/backup/ --parents | find and copy all files with '.txt' extention from a directory to another |
find /var/log -name '*.log' | tar cv --files-from=- | bzip2 > log.tar.bz2 | find all files with '.log' extention and make an bzip archive |
dd if=/dev/hda of=/dev/fd0 bs=512 count=1 | make a copy of MBR (Master Boot Record) to floppy |
dd if=/dev/fd0 of=/dev/hda bs=512 count=1 | restore MBR from backup copy saved to floppy |
| |
CDROM | |
cdrecord -v gracetime=2 dev=/dev/cdrom -eject blank=fast -force | clean a rewritable cdrom |
mkisofs /dev/cdrom > cd.iso | create an iso image of cdrom on disk |
mkisofs /dev/cdrom | gzip > cd_iso.gz | create a compressed iso image of cdrom on disk |
mkisofs -J -allow-leading-dots -R -V "Label CD" -iso-level 4 -o ./cd.iso data_cd | create an iso image of a directory |
cdrecord -v dev=/dev/cdrom cd.iso | burn an ISO image |
gzip -dc cd_iso.gz | cdrecord dev=/dev/cdrom - | burn a compressed ISO image |
mount -o loop cd.iso /mnt/iso | mount an ISO image |
cd-paranoia -B | rip audio tracks from a CD to wav files |
cd-paranoia -- "-3" | rip first three audio tracks from a CD to wav files |
cdrecord --scanbus | scan bus to identify the channel scsi |
Networking - LAN and WiFi | |
ifconfig eth0 | show configuration of an ethernet network card |
ifup eth0 | activate an interface 'eth0' |
ifdown eth0 | disable an interface 'eth0' |
ifconfig eth0 192.168.1.1 netmask 255.255.255.0 | configure IP Address |
ifconfig eth0 promisc | configure 'eth0' in promiscuous mode to gather packets (sniffing) |
dhclient eth0 | active interface 'eth0' in dhcp mode |
route -n | show routing table |
route add -net 0/0 gw IP_Gateway | configura default gateway |
route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.1.1 | configure static route to reach network '192.168.0.0/16' |
route del 0/0 gw IP_gateway | remove static route |
echo "1" > /proc/sys/net/ipv4/ip_forward | activate ip routing |
hostname | show hostname |
host www.linuxguide.it | lookup hostname to resolve name to ip address and viceversa |
ip link show | show link status of all interfaces |
mii-tool eth0 | show link status of 'eth0' |
ethtool eth0 | show statistics of network card 'eth0' |
netstat -tup | show all active network connections and their PID |
netstat -tupl | show all network services listening on the system and their PID |
tcpdump tcp port 80 | show all HTTP traffic |
iwlist scan | show wireless networks |
iwconfig eth1 | show configuration of a wireless network card |
| |
Microsoft Windows networks - SAMBA | |
nbtscan ip_addr | netbios name resolution |
nmblookup -A ip_addr | netbios name resolution |
smbclient -L ip_addr/hostname | show remote shares of a windows host |
smbget -Rr smb://ip_addr/share | like wget can download files from a host windows via smb |
mount -t smbfs -o username=user,password=pass //winclient/share /mnt/share | mount a windows network share |
| |
IPTABLES - firewall | |
iptables -t filter -L | show all chains of filtering table |
iptables -t nat -L | show all chains of nat table |
iptables -t filter -F | clear all rules from filtering table |
iptables -t nat -F | clear all rules from table nat |
iptables -t filter -X | delete any chains created by user |
iptables -t filter -A INPUT -p tcp --dport telnet -j ACCEPT | allow telnet connections to input |
iptables -t filter -A OUTPUT -p tcp --dport http -j DROP | block HTTP connections to output |
iptables -t filter -A FORWARD -p tcp --dport pop3 -j ACCEPT | allow POP3 connections to forward chain |
iptables -t filter -A INPUT -j LOG --log-prefix "DROP INPUT" | logging sulla chain di input Logging on chain input |
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE | configure a PAT (Port Address Traslation) on eth0 masking outbound packets |
iptables -t nat -A PREROUTING -d 192.168.0.1 -p tcp -m tcp --dport 22 -j DNAT --to-destination 10.0.0.2:22 | redirect packets addressed to a host to another host |
| |
Monitoring and debugging | |
top | display linux tasks using most cpu |
ps -eafw | displays linux tasks |
ps -e -o pid,args --forest | displays linux tasks in a hierarchical mode |
pstree | mostra un albero dei processi sistema Shows a tree system processes |
kill -9 ID_Processo | force closure of the process and finish it |
kill -1 ID_Processo | force a process to reload configuration |
lsof -p $$ | display a list of files opened by processes |
lsof /home/user1 | displays a list of open files in a given path system |
strace -c ls >/dev/null | display system calls made and received by a process |
strace -f -e open ls >/dev/null | display library calls |
watch -n1 'cat /proc/interrupts' | display interrupts in real-time |
last reboot | show history reboot |
lsmod | display kernel loaded |
free -m | displays status of RAM in megabytes |
smartctl -A /dev/hda | monitoring reliability of a hard-disk through SMART |
smartctl -i /dev/hda | check if SMART is active on a hard-disk |
tail /var/log/dmesg | show events inherent to the process of booting kernel |
tail /var/log/messages | show system events |
Other useful commands | |
mkbootdisk --device /dev/fd0 `uname -r` | create a boot floppy |
gpg -c file1 | encrypt a file with GNU Privacy Guard |
gpg file1.gpg | decrypt a file with GNU Privacy Guard |
wget -r www.example.com | download an entire web site |
wget -c www.example.com/file.iso | download a file with the ability to stop the download and resume later |
echo 'wget -c www.example.com/files.iso' | at 09:00 | start a download at any given time |
Posted by Tony at 1:55 PM 0 comments