Command line for Ubuntu and RedHat
The ones with * may work only in one version. In Ubuntu some commands require sudo before the instruction to have root rights
Sound troubleshooting
*alsamixer
Reset command line
*reset
Kill a process
Find out its pid with: ‘ps -e’ and to kill it: ‘kill -9′
Hide completely Gnome Panel
In gconf_editor: apps/panel/toplevels/button_level_screen0
Restart network
/etc/init.d/networking restart
Users, groups, passwords
useradd UserName
userdel UserName
passwd UserName
groupadd GroupName
Logins
su – : Root
su UserName
Manage the status of programs. For instance, to know the status of nfs type: ‘/etc/init.d/nfs status’
/etc/init.d/ status|start|restart|stop
Copy, delete, rename, find files. For directories include ‘-r’
rm FileName: Delete file
cp file Location/file : Copy file into Location given
mv file Location/file : Remove file and place it onto location given
- Search for name_file in directory_path and its subdirectories
find directory_path -name ‘name_file’
- File’s data was last modified n*24 hours ago. Last time of modification of the file itself
find directory_path -mtime n
- File’s data was last modified n*24 hours ago. Last modification of the inode (file created, mode changed, etc.)
find directory_path -mtime n
- Find files modified last n minutes
find -cmin n
- Like -name, but the match is case insensitive.
find directory_path -iname pattern
Permissions
chmod 666 file_name: read and write rights
chmod 775 file_name: all rights
chmod 700 file_name: make a file executable
Display file info
ls -l : know permissions ls -a: show all files
Network
*/etc/sysconfig/network:SetupHostname
*/etc/sysconfig/network-scripts/ifcfg-eth0: Setup ip address
ifconfig -a: Network info *setup
Installation process to install software
Uncompress package (zip, tar, tar.gz, …See below HowTo Uncompress)
cd package
./configure
make
make check (to make sure the installation is successfully, not necessary)
make install
If installation fails: make clean
PC features
General info: uname -a
Kernel: uname -r
HD: df -h
Memory: free -m
List the existing partitions: fdisk -l
Uncompress:
tar -xvfz filename.tar
tar -xvjf filename.tar.bz2
tar -xvzf filename.tar.gz
unzip filename.zip
*RPM packages
rpm -ivh package.rpm : install
rpm -i packag.rpm : install
rpm -Uvh package.scr.rpm: install
rpm -V package.scr.rpm: Verify
rpm -e package: remove
rpm -e –nodeps package: force remove
rpm -qa package: check if package is installed
rpm -qalgrep package: check if package is installed
GENERAL
pwd: current directory
ps: print status
history | more: history of 1000 last commands by screens
history | grep <topic>: show the commands typed related to <topic>
apropos topic: list of topics related
*ntsysv: run programs at boot time (To check on any service: SPACE)
scp file_name machine_name:directory_destination To copy file_name into machine 10.1.1.0 in the directory tmp ’scp file_name 10.1.1.0:/tmp’
Show all ports open in current machine
netstat -lnptuw *netstat -nap | grep
Troubleshooting
Wireless in RHEL4
http://www.linuxquestions.org/questions/linux-enterprise-47/cannot-get-wireless
http://vijayk.blogspot.com/2006/11/how-to-enable-wireless-lan-on-wifi-fc-6.html
Can’t save bookmarks for Firefox 3
http://support.mozilla.com/tiki-iew_forum_thread.php?forumId=1&comments_parentId=57587
How to get rid of multiple windows which open one after another in RHEL5
In your File Browser:
edit
preferences
behaviour
click in always open in browser windows
Recover Password
http://www.wallpaperama.com/forums/how-to-reset-linux-root-passwords
http://www.ubuntugeek.com/how-to-recover-password-under-ubuntu.html
KDE Help Center
http://taufanlubis.wordpress.com/2008/05/02/khelpcenter-%e2%80%93-kde-help-center/
How to recover RHEL Grub boot loader
var YAHOO = {‘Shortcuts’ : {}};
if (typeof YAHOO == “undefined”) {
var YAHOO = {};
}
YAHOO.Shortcuts = YAHOO.Shortcuts || {};
YAHOO.Shortcuts.hasSensitiveText = false;
YAHOO.Shortcuts.sensitivityType = [];
YAHOO.Shortcuts.doUlt = false;
YAHOO.Shortcuts.location = “us”;
YAHOO.Shortcuts.document_id = 0;
YAHOO.Shortcuts.document_type = “”;
YAHOO.Shortcuts.document_title = “to blog”;
YAHOO.Shortcuts.document_publish_date = “”;
YAHOO.Shortcuts.document_author = “a13x.es@gmail.com”;
YAHOO.Shortcuts.document_url = “”;
YAHOO.Shortcuts.document_tags = “”;
YAHOO.Shortcuts.document_language = “”;
YAHOO.Shortcuts.annotationSet = {
“lw_1223694639_0″: {
“text”: “http://linux.ittoolbox.com/groups/technical-functional/redhat-l/how-to-recover-grub-boot-loader-1810841″,
“extended”: 0,
“startchar”: 129,
“endchar”: 231,
“start”: 129,
“end”: 231,
“extendedFrom”: “”,
“predictedCategory”: “”,
“predictionProbability”: “0″,
“weight”: 1,
“relScore”: 0,
“type”: ["shortcuts:/us/instance/identifier/hyperlink/http"],
“category”: ["IDENTIFIER"],
“wikiId”: “”,
“relatedWikiIds”: [],
“relatedEntities”: [],
“showOnClick”: [],
“context”: “http://linux.ittoolbox.com/groups/technical-functional/redhat-l/how-to-recover-grub-boot-loader-1810841″,
“metaData”: {
“linkHref”: “http://linux.ittoolbox.com/groups/technical-functional/redhat-l/how-to-recover-grub-boot-loader-1810841″,
“linkProtocol”: “http”,
“linkTarget”: “_blank”,
“visible”: “true”
}
}
};
YAHOO.Shortcuts.headerID = “01a7e17e611489f0c0d0b6dac1edce28″;
more to come …
Cool stuff
Blog happily ever after(Firefox only)
How to save youtube videos in Firefox using YouPlayer
- In Firefox, download the add-on YouPlayer
- CTRL+SHIFT+y to open YouPlayer in the web browser
- Drag Youtube videos onto the YouPlayer window
- Right click in the video and download into your computer
Play your favorites songs in Firefox using YouPlayer
- Save list of songs in your USB. In YouPlayer: List opts/Save List
- Install YouPlayer in any computer that has Firefox (don’t need admin rights)
- CTRL+SHIFT+y to open YouPlayer in the web browser
- Load your list in the computer you want to use: List opts/Load List
- Enjoy, also you may want to uninstall YouPlayer at the end
more to come …
Howto’s
How to enable Wireless Lan on [wifi] FC-6
http://vijayk.blogspot.com/2006/11/how-to-enable-wireless-lan-on-wifi-fc-6.html
Wireless setup
http://wiki.archlinux.org/index.php/Wireless
https://help.ubuntu.com/community/WifiDocs/Driver/Ndiswrapper
Ndiswrapper
http://ndiswrapper.sourceforge.net/joomla/index.php?/component/option,com_openwiki/Itemid,33/id,installation/
How to GIMP
http://www.gimp.org/tutorials/
Linux guide
http://www.linux.ie/newusers/beginners-linux-guide/
RHEL SSH
http://gizeh.wordpress.com/2008/10/11/ssh/
Hard and Soft Links
http://gizeh.wordpress.com/2008/10/11/hard-and-soft-links/
Developers2
KSystemLog – System Log Viewer for KDE
http://ksystemlog.forum-software.org/
Apt-rpm Questions and Answers
http://apt4rpm.sourceforge.net/faq.html
Modify IP
http://www.itsyourip.com/redhat/how-to-addmodify-ip-address-in-redhat-enterprise-linux/
Exploring Linux kernel
http://theos.in/desktop-linux/tip-that-matters/exploring-linux-kernel/
http://www.systhread.net/texts/200510kdiff.php
http://www.bellevuelinux.org/kernel.html
Regular expressions are strings for describing a search pattern
TeX Macros
http://amath.colorado.edu/documentation/LaTeX/reference/macros/
Draw diagrams
To install dia run: “sudo apt-get install dia-gnome”
Or use, Open Office Drawing
Understanding tcp connections
http://www.linuxjournal.com/article/6447
NFS
http://nfs.sourceforge.net/nfs-howto/index.html
https://help.ubuntu.com/7.10/server/C/
Tutorial UML
http://visualcase.com/tutorials/use-case-diagram.htm
Wireless Hack book
http://www.freeopenbook.com/wireless-hacks/main.html
How set up MRTG in Ubuntu
Running programs as demos with cron
PostgreSQL is an open-source Object-Relational DBMS
Zenoss is an open source application, server and network management
Downgrade firmware from 2.0 to 1.1.4
Downgrade firmware from 2.0 to 1.1.4
Downgrade baseband from 4.05.04_G to 4.04.05_G
The mistake basically is to update to iTunes 7.7 because it will installed 2.0 in your iPhone and with this the jailbreak will not work.
Steps
Uninstall iTunes 7.7 ; Install 7.5; Reboot
Put your iPhone in DFU mode which let you upgrade or downgrade the OS. If you see the cable and connect to iTunes, you did not get into DFU mode.
· Attach the phone to the pc
· Turn the phone off
· Hold power and home together for *exactly* 10 seconds
· Release power but keep holding home until the pc beeps as a USB device is recognized.
· At no point will the display come on. Now your restore should work.
- Restore using iTunes 7.5. You will get an error like 1011, 1012, 1013, 1015. This is normal and expected. An error 1601, 1602, 1600 or anything else is not ok.
- Once you get error above, leave iTunes open and but cancel the restore mode. It will not work if you try to restore.
- Now run winpwn and pwning the device at this point. The normal restore still won’t work which is good because it gives you the chance to fix some errors such as in youtube and yahoo email.
- With iTunes open. Install and run iLiberty+
- You should be able to use normal restore mode
- Once completed, you have a pwned device with baseband 4.05.04_G from your firmware v2.0 which no longer exists. Next step is downgrade the baseband to 04.04.05_G. To do this use the Ziphone patch.
- I recommend just loading winpwn(PC) or pwnage(MAC) and pwning the device at this point. If pwnage fails to work, you need to restore your phone again. You should be able to use normal restore mode, however. Other ways to kick out of restore mode may be ibrickr, jailbreak 1.1.2 (boot phone), iLiberty+.
To know which bootloader version your iPhone has
The easiest method is to see the serial no on back of the iphone. The 4th & 5th digit from starting of serial no will give you the week of release.
LINKS
Installation Notes
Tips to solve common problems during and after Linux installation.
For multiple partitions:
http://www.psychocats.net/ubuntu/installing
“Guided Partitioning” is a tool that needs to take advantage because it does some of the job for you. My favorite method is to free a partition in Windows (shrink) and later during Ubuntu installation use “Guided – use the largest continuous free space“
How to access your Windows hard drive from Ubuntu
http://technical-itch.co.uk/2006/11/06/how-to-access-your-windows-hard-drive-from-ubuntu/
How to recover a Grub if:
1. Hard Drive with Grub installed was removed.
Use the Ubuntu cd
Choose “recover broken system” option
Enter the correct info such as root location, username, etc.
In the menu, choose “reinstall grub”, and after “reboot”
2. Ubuntu overwrote the previous Grub, and now you can’t see you previous Linux installation
http://www.linuxforums.org/forum/ubuntu-help/112474-adding-red-hat-my-menu-lst-file.html
More info about GRUB
http://www.gnu.org/software/grub/manual/html_node/Installing-GRUB-natively.html
http://ubuntuforums.org/showthread.php?t=224351
Recovering Ubuntu after installing Windows
https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows
Mounting a hard drive in Ubuntu
http://ubuntuforums.org/showthread.php?t=687376
Mounting a hard drive in RedHat
http://www.linux-ntfs.org/doku.php?id=ntfsmount
Boot from USB
https://help.ubuntu.com/community/BootFromUSB
Fix to initrams
http://ubuntuforums.org/showthread.php?t=767154&highlight=busy+box&page=3
Developers
Securing Linux
http://www.puschitz.com/SecuringLinux.shtml
Xserver problems
http://ubuntuforums.org/showthread.php?t=187177
How to setup a proxy server in ubuntu
In the terminal type:
sudo export http_proxy=http://user:pass@proxyserver:port
Open Source programs
http://www.wiley.com/legacy/compbooks/schiffman/
Unix Programming
http://wps.prenhall.com/esm_molay_UNIXProg_1/
Beowulf cluster
http://tldp.org/HOWTO/Beowulf-HOWTO/
Data Structures in C++
http://www.cs.fiu.edu/~weiss/dsaa_c2e/files.html
Perl dependence in Ubuntu
sudo apt-get install libperl-dev
http://www.unix.com.ua/orelly/perl/prog3/ch21_04.htm
Writing scripts
http://freeos.com/guides/lsst/ch02sec01.html
Modelling object-oriented software
http://openlearn.open.ac.uk/mod/resource/view.php?id=173545
http://objc.toodarkpark.net/oop.html
Ubuntu customization 2
To setup grub password in Ubuntu
sudo apt-get install imagemagick
sudo apt-get install startupmanager
To hide completely the upper panel after checking option “Autohide”
alt+f2
gconf-editor
apps, panel, top levels
size = 0
Customize Keyboard Shortcuts (System/Preferences/Keyboard Shortcuts)
Remember always back up not only your hard drive but also your Browser Bookmarks, Mail Settings, YouPlayer List (if you have one) …
Print manager
gnome-cups-manager
Unhide Programs
Go to System/Preferences/Main Menu
Install Google Gadgets for Linux on Ubuntu
Conky, a light weight system monitor
Unfortunately, conky has few problems, however below are some tips to fix them
no flikering problem
boot time problem
Manage Engines in Firefox
To add: Click in the downside triangle located in the google bar, choose “Manage Search Engines …”, and then “Get More Search Engines”
Or add then directly from the link above
https://addons.mozilla.org/en-US/firefox/browse/type:4/cat:all?sort=name
My favorites are: Merrian webster dictionary, Wikipedia
Command line 2
Set date to 7:30 am 1st October 2015
sudo touch -t 201510010730 file.txt
To display the first 20 lines of a file
head –n 20 file.txt
To display the last 20 lines of a file
tail –n 20 file.txt
Show System log info
gnome-system-log &
* To remove an application from boot time
/etc/init.d/program stop
chkconfig program off (only in RedHat)
Some of the following commands, may need to use the pipe more at the end: command | more
lspci: list all PCI devices
lsmod: program that shows the status of modules in the Linux Kernel
iwconfig: show wireless interfaces
/sbin/ifconfig: ip info
du: estimate file space usage
PCI ID
First identify the card you have with lspci and note the first column such as 0000:00:0c.0 and then find out the PCI ID of the card by running lspci -n
To know where drivers are saved
ls -d /lib/modules/$(uname -r)
dmesg: System Log messages
cat as an editor
- cat > file_name
- Enter whatever you need to edit
- ctrl + d: to exit
concatenate instructions
intruction1 && instruction2
For example: ls && ls -a
*system-config-network: Network configuration
ldconfig: creates the necessary links and cache to the most recent shared libraries
type shell instructions in file_name
chmod 755 file_name
./file_name
iptables –nvL: firewall settings
wc: print the number of newlines, words, and bytes in files
Open file browser as root
sudo nautilus
Trace system calls, signals, executables
strace to_be_trace_name, i.e. strace ls
more commands
http://www.catonmat.net/blog/the-definitive-guide-to-bash-command-line-history/
http://www.oracle.com/technology/pub/articles/calish_file_commands.html
http://www.ss64.com/bash/
-
Archives
- February 2009 (1)
- November 2008 (11)
- October 2008 (4)
- September 2008 (8)
- August 2008 (10)
- June 2008 (2)
- May 2008 (1)
- April 2008 (1)
-
Categories
-
RSS
Entries RSS
Comments RSS