Linux: Difference between revisions
From esoterum.org
Jump to navigationJump to search
| (26 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
== Fedora 9 == | == Fedora 9 == | ||
*[http://www.linuxforums.org/forum/red-hat-fedora-linux/129316-solved-no-sound-when-you-tube-contents-run-fedora-9-a.html Install flash sound support]: <code>yum install pulseaudio-libs libflashsupport</code> | |||
*[http://www.linuxquestions.org/questions/fedora-35/boot-to-command-prompt-fedora-9-a-654830/ Boot to single user mode] | |||
*[http://fedoraproject.org/wiki/JavaFAQ Java FAQ on the Fedora wiki] | |||
*[http://www.thoughtpolice.co.uk/vmware/howto/fedora-9-vmware-tools-install.html Installing VMware tools] | *[http://www.thoughtpolice.co.uk/vmware/howto/fedora-9-vmware-tools-install.html Installing VMware tools] | ||
*[http://www.mjmwired.net/resources/mjm-services-f9.html List of services and recommendations] | *[http://www.mjmwired.net/resources/mjm-services-f9.html List of services and recommendations] | ||
| Line 10: | Line 13: | ||
*<code>su -</code> change to super user | *<code>su -</code> change to super user | ||
Add user: | Add user: | ||
*<code>adduser username</code> | *<code>/sbin/adduser username</code> | ||
*<code>passwd username</code> | *<code>passwd username</code> | ||
Add user to sudo list: | Add user to sudo list: | ||
| Line 50: | Line 53: | ||
=== Command Line === | === Command Line === | ||
*[http://linuxgazette.net/issue38/tag/6.html Getting host and user names], host name | |||
*[http://www.redhat.com/docs/manuals/linux/RHL-7.2-Manual/ref-guide/s1-init-boot-shutdown-init.html init and runlevels] | |||
*[http://www.perpetualpc.net/srtd_commands_rev.html Common Linux commands] | *[http://www.perpetualpc.net/srtd_commands_rev.html Common Linux commands] | ||
*[http://www.computerhope.com/unix/overview.htm Common Linux commands] | *[http://www.computerhope.com/unix/overview.htm Common Linux commands] | ||
| Line 63: | Line 68: | ||
:<code>lspci</code> (list pci devices) | :<code>lspci</code> (list pci devices) | ||
:<code>df</code> (hard drive information) | :<code>df</code> (hard drive information) | ||
:<code>du -k /home/ | sort -n | tail -10</code> [http://recursive-design.com/blog/2007/02/06/find-large-folders/ find 10 largest folders in specified directory] | |||
*<code>id</code> get my UID | *<code>id</code> get my UID | ||
*<code>pkill -U [UID]</code> Logoff user "UID" | *<code>pkill -U [UID]</code> Logoff user "UID" | ||
| Line 79: | Line 86: | ||
*<code>top</code> (processes dynamic list) | *<code>top</code> (processes dynamic list) | ||
*<code>strace ./ldecod.exe -e trace=gmon.out</code> Debugging: print system calls made by ldecod.exe during execution | *<code>strace ./ldecod.exe -e trace=gmon.out</code> Debugging: print system calls made by ldecod.exe during execution | ||
*<code>md5sum [filename]</code> Generate md5 hash of [filename] | *<code>md5sum [filename]</code> Generate md5 hash of [filename] | ||
*<code>ar -s</code> or <code>ranlib</code> add index to archive (.a) file | *<code>ar -s</code> or <code>ranlib</code> add index to archive (.a) file | ||
| Line 109: | Line 112: | ||
== Networking == | == Networking == | ||
*[http://tdistler.com/2008/10/14/setting-the-dhcp-hostname-on-linux How to set dhcp hostname in linux] | |||
*[https://www4.nau.edu/its/pcsupport/network/dhcp/winxp.aspx Set dhcp hostname in windows xp] | |||
*[http://iptables-tutorial.frozentux.net/iptables-tutorial.html Very thorough tutorial on TCP/IP and iptables], Oskar Andreasson | *[http://iptables-tutorial.frozentux.net/iptables-tutorial.html Very thorough tutorial on TCP/IP and iptables], Oskar Andreasson | ||
== Utilities == | == Utilities == | ||
=== yum === | |||
*[http://www.linuxquestions.org/questions/linux-newbie-8/trying-to-install-skype-on-fedora-12-a-832589/ Set up yum repository for skype] | |||
=== bluefish === | |||
*[http://bluefish.openoffice.nl/ Home at openoffice], bluefish is | |||
:*Bluefish is a powerful editor targeted towards programmers and webdesigners, with many options to write websites, scripts and programming code. | |||
=== cron === | |||
*[http://www.snow.nl/dist/xhtmlc/ch13s07.html crontab information], editing cron's tasks | |||
=== tar/bzip === | |||
*<code>bzip2 -cd files.tar.bz2 | tar xvf -</code> Bzip | |||
*<code>tar -cf ouput.tar folder</code> Tar a folder | |||
*<code> tar -czvf output.tar.gz folder</code> Tar and gzip a folder | |||
*<code>tar -xzvf input.tar.gz</code> Untar and unzip a tar-ball | |||
=== poster === | |||
*[http://www.inkguides.com/eps-postscript-poster.asp poster], create multipage postscript files from postscript input | |||
=== gdb === | |||
*>[http://www.cs.utah.edu/dept/old/texinfo/gdb/gdbint.html GDB Internals from U Utah] | |||
*[http://darkdust.net/files/GDB%20Cheat%20Sheet.pdf cheat sheet] | |||
*[http://www.eecs.harvard.edu/~mdw/course/cs161/handouts/gdb.html Quick reference from Harvard] | |||
*<code>x/16w $sp</code> display 16 words starting at address of stack pointer | |||
*<code>display/x {long long int}__ovly_current</code> after every halt display contents of address __ovly_current as long long int in hexidecimal format | |||
*<code>set spu stop-on-load on</code> set temporary breakpoint upon entry to spu code in ppu-gdb | |||
=== find === | |||
*[http://ss64.com/bash/find.html#examples find examples] | |||
=== [http://www.simplehelp.net/2008/12/01/how-to-send-email-from-the-linux-command-line/ Mail] === | === [http://www.simplehelp.net/2008/12/01/how-to-send-email-from-the-linux-command-line/ Mail] === | ||
=== [http://ccrma.stanford.edu/planetccrma/man/man1/avr-nm.1.html nm] === | === [http://ccrma.stanford.edu/planetccrma/man/man1/avr-nm.1.html nm] === | ||
*<code>nm --size-sort *.o > function_sizes.nm</code> report sizes of all functions in given object files | *<code>nm --size-sort *.o </code>><code> function_sizes.nm</code> report sizes of all functions in given object files | ||
=== Virtual Network Computing (VNC) Server === | === Virtual Network Computing (VNC) Server === | ||
| Line 128: | Line 162: | ||
=== grep === | === grep === | ||
*<code>grep -lir "[text]"</code> find file containing | *<code>grep -lir "[text]"</code> find file containing | ||
#<code>find . | xargs grep whatever</code> recursively find text starting from . | |||
=== xev === | === xev === | ||
| Line 166: | Line 201: | ||
*[ftp://download.intel.com/software/products/opensource/downloads/howto0_.pdf Cross compiler for Arm information] | *[ftp://download.intel.com/software/products/opensource/downloads/howto0_.pdf Cross compiler for Arm information] | ||
*[http://ftp.snapgear.org/pub/snapgear/tools/arm-linux/build-arm-linux-3.4.4 How to build arm-linux toolchain for ARM/XSCALE] | *[http://ftp.snapgear.org/pub/snapgear/tools/arm-linux/build-arm-linux-3.4.4 How to build arm-linux toolchain for ARM/XSCALE] | ||
==== | ==== gcc ==== | ||
*[http://en.wikibooks.org/wiki/GNU_C_Compiler_Internals/Print_version Online book: GNU C Compiler Internals] | *[http://en.wikibooks.org/wiki/GNU_C_Compiler_Internals/Print_version Online book: GNU C Compiler Internals] | ||
*[http://www.cse.iitb.ac.in/~uday/courses/cs324-05/gccProjects/node4.html Dumping intermediate formats] | *[http://www.cse.iitb.ac.in/~uday/courses/cs324-05/gccProjects/node4.html Dumping intermediate formats] | ||
*[http://books.google.com/books?id=wQ6r3UTivJgC&pg=PA361&lpg=PA361&dq=gcc+cfg+dump&source=bl&ots=EJXjOn5xJz&sig=pEm_-EYsj-aBgRFrO_q8JFyr1IU&hl=en&ei=XASFSpqFN4PwsQP99sWVBw&sa=X&oi=book_result&ct=result&resnum=4#v=onepage&q=gcc%20cfg%20dump&f=false ''The Difinitive Guide to GCC''] | *[http://books.google.com/books?id=wQ6r3UTivJgC&pg=PA361&lpg=PA361&dq=gcc+cfg+dump&source=bl&ots=EJXjOn5xJz&sig=pEm_-EYsj-aBgRFrO_q8JFyr1IU&hl=en&ei=XASFSpqFN4PwsQP99sWVBw&sa=X&oi=book_result&ct=result&resnum=4#v=onepage&q=gcc%20cfg%20dump&f=false ''The Difinitive Guide to GCC''] | ||
*[http://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/Optimize-Options.html gcc flags] | *[http://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/Optimize-Options.html gcc flags] | ||
*[http://blog.flameeyes.eu/2008/01/17/today-how-to-identify-unused-exported-functions-and-variables Information on -Wl,--gc-sections linker option] | |||
==== XLC ==== | ==== XLC ==== | ||
| Line 176: | Line 212: | ||
=== Make === | === Make === | ||
*>>[http://www.gnu.org/software/automake/manual/make/Functions.html Make functions], string manipulation etc. | |||
*[http://sourceforge.net/projects/gcmakefile/ generic makefile on sourceforge], text [http://www.esoterum.org/mw/images/4/4c/Makefile.txt here] | *[http://sourceforge.net/projects/gcmakefile/ generic makefile on sourceforge], text [http://www.esoterum.org/mw/images/4/4c/Makefile.txt here] | ||
*[http://www.gnu.org/software/make/manual/make.html Make manual] | *[http://www.gnu.org/software/make/manual/make.html Make manual] | ||
Latest revision as of 02:55, 29 December 2010
Fedora 9
- Install flash sound support:
yum install pulseaudio-libs libflashsupport - Boot to single user mode
- Java FAQ on the Fedora wiki
- Installing VMware tools
- List of services and recommendations
- Custom Kernel
- Building kernel from source RPM
- Building kernel for PS3
Fedora 7
- Fedora FAQ
su -change to super user
Add user:
/sbin/adduser usernamepasswd username
Add user to sudo list:
echo 'loginname ALL=(ALL) ALL' >> /etc/sudoersWhere 'loginname' is your user account. Use 'ALL=(ALL) NOPASSWD:ALL' if you don't want to require a password
Add user to existing group (precede with su -):
usermod -G {groupname} {username}sudo chown -R new_owner:new_group folderRecursively change owner and group of folderinit [number]set runmode number (5=graphical, 3=text, 1=single user)[ctl][alt][F1]switch to text mode[ctl][alt][F7]switch to graphical mode
KDE
startkdestart KDE (from ssh)- Added
xset r offto.bashrchopefully fixing annoying problem with unwanted repeating characters when using VNC based on this conversation. - Attempted to set up remote desktop sharing through ssh, so far not really working:
- %
krfb - %
vncviewer localhost:5900 - -Added XTEST(X11R6) to Exceed Xconfig under X Server Protocol, Extensions Tab
CygWin
- Installing minicom on cygwin:
- Add folder:
/var/lock
- Move file
minirc.dfl to /usr/local/etc
- Fix serial port
/dev/ttyS1 -> /dev/com1 ???
Unix/Linux
Command Line
- Getting host and user names, host name
- init and runlevels
- Common Linux commands
- Common Linux commands
history
- count lines of code in a directory http://vision-media.ca/resources/unix/counting-lines-in-a-script
find . -type f | xargs wc -l
find . -type f -name '*.c' | xargs wc -l specific file type
mount -o loop disk1.iso [/directory] Mount an .iso file
- To get information on the server/computer:
cat /proc/cpuinfo
cat /proc/meminfo
dmesg
lspci (list pci devices)
df (hard drive information)
du -k /home/ | sort -n | tail -10 find 10 largest folders in specified directory
id get my UID
pkill -U [UID] Logoff user "UID"
pgrep looks through the currently running processes and lists the process IDs which matches the selection criteria to stdout.
ifconfig network/ip information | /sbin/ifconfig if not root
sysctl kernel.hostname=NEW_HOSTNAME to permanantly change hostname
service network restart restart network services
find . -name "rc.conf" -print
xhost +[server name, i.e. vlsi] (give permission to remote server to use local display)
setenv DISPLAY=###.###.###.###:0.0 (set DISPLAY variable to local ip address)
cat /var/log/messages |grep *** (Search system messages for specific word)
service xinetd restart (Restart xinetd server)
rpm -ivh foo-1.0-1.i386.rpm (Add a package with rpm)
rpm -e foo (Remove a package with rpm)
ps (processes)
top (processes dynamic list)
strace ./ldecod.exe -e trace=gmon.out Debugging: print system calls made by ldecod.exe during execution
md5sum [filename] Generate md5 hash of [filename]
ar -s or ranlib add index to archive (.a) file
Software
- cloc: utility for counting lines of code
- meld: compare and merge up to three files
- yay: yet another YUV viewer
%yay [-s <with>x<height>] <filename>.yuv
- mpeg4ip tools: toolbox for mp4, avi, mov, etc. (!!! Could only find executables for Windows !!!)
%mp4info.exe [file.mp4]
%mp4creator -extract=1 file.avi file.264 (extract track number based on info given by mp4info.exe
- gprof: gnu profiling software
%gprof [executable] gmon.out > [gprof.out]
gmon.out is generated by compiling target executable with -pg as a compiler and linker flag, then running the resulting executable normally
- cgprof: generate call-graph based on gprof data
cgprof -T ps -g [gprof.out] [gprof.ps] (output postscript file)
- Converting postscript to other format.
- -Use Windows GhostScript->convert to generate a .tif (600dpi) or .pdf (720dpi) or one of several other formats
- -For poster size images generate .pdf with GhostScript and open with PaintShop Pro using high dpi value, then save as .tif or other file and print with MS Publisher as poster
egypt Create call graph from gcc's rtl dump
links text based browser
Drivers
Networking
Utilities
yum
bluefish
- Home at openoffice, bluefish is
- Bluefish is a powerful editor targeted towards programmers and webdesigners, with many options to write websites, scripts and programming code.
cron
- crontab information, editing cron's tasks
tar/bzip
bzip2 -cd files.tar.bz2 | tar xvf - Bzip
tar -cf ouput.tar folder Tar a folder
tar -czvf output.tar.gz folder Tar and gzip a folder
tar -xzvf input.tar.gz Untar and unzip a tar-ball
poster
- poster, create multipage postscript files from postscript input
gdb
- >GDB Internals from U Utah
- cheat sheet
- Quick reference from Harvard
x/16w $sp display 16 words starting at address of stack pointer
display/x {long long int}__ovly_current after every halt display contents of address __ovly_current as long long int in hexidecimal format
set spu stop-on-load on set temporary breakpoint upon entry to spu code in ppu-gdb
find
Mail
nm
nm --size-sort *.o > function_sizes.nm report sizes of all functions in given object files
Virtual Network Computing (VNC) Server
- VNC on Wikipedia
- TightVNC information
vncserver :1 -geometry 1880x1160
vncviewer localhost:# over ssh
/etc/sysconfig/vncservers
/sbin/service vncserver restart
vncserver -kill :1
grep
grep -lir "[text]" find file containing
find . | xargs grep whatever recursively find text starting from .
xev
- Track interface signals such as key presses and mouse movement
Bootloader
USBNET (USBDNET)
- -BLOB requires cdc_subset module (
# modprobe cdc_subset)
- gadget driver information (linux-usb.org)
- remove linux 2.6 usb 2.0 driver?
modprobe -r ehci-hcd
- -apparently
uhci-hcd is the usb 1.0 driver from linux 2.4
public key authentication
scp
rsync
- Making secure remote backups with Rsync
rsync -avz -e ssh ~/source/ user@host:~/destination/
sed
ls *old|sed 's/\(.*\)\.old/mv \1.old \1.new/'|sh
TFTP
Compilers
gcc
XLC
Make
- >>Make functions, string manipulation etc.
- generic makefile on sourceforge, text here
- Make manual
- Various Make statements
- Advanced Makefile reference
Fedora Red Hat Enterprise Linux (RHEL)