Difference between revisions of "Linux"

From esoterum.org
Jump to: navigation, search
(New page: *[ftp://download.intel.com/software/products/opensource/downloads/howto0_.pdf Cross compiler for Arm information])
 
(Command Line)
 
(159 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
== 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.mjmwired.net/resources/mjm-services-f9.html List of services and recommendations]
 +
*[http://fedoraproject.org/wiki/Docs/CustomKernel Custom Kernel]
 +
*[http://fedoraproject.org/wiki/Docs/CustomKernel Building kernel from source RPM]
 +
*[http://linuxonps3.wordpress.com/2008/12/30/building-a-custom-kernel-for-ps3/ Building kernel for PS3]
 +
 +
== Fedora 7 ==
 +
*[http://www.fedorafaq.org/basics/ Fedora FAQ]
 +
*<code>su -</code> change to super user
 +
Add user:
 +
*<code>/sbin/adduser username</code>
 +
*<code>passwd username</code>
 +
Add user to sudo list:
 +
*<code>echo 'loginname ALL=(ALL) ALL' >> /etc/sudoers</code> Where '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 <code>su -</code>):
 +
*<code>usermod -G {groupname} {username}</code>
 +
*<code>sudo chown -R new_owner:new_group folder</code> Recursively change owner and group of folder
 +
*<code>init [number]</code> set runmode number (5=graphical, 3=text, 1=single user)
 +
*<code>[ctl][alt][F1]</code> switch to text mode
 +
*<code>[ctl][alt][F7]</code> switch to graphical mode
 +
 +
 +
=== KDE ===
 +
*<code>startkde</code> start KDE (from ssh)
 +
*Added <code>xset r off</code> to <code>.bashrc</code> hopefully fixing annoying problem with unwanted repeating characters when using VNC based on [http://bugs.kde.org/show_bug.cgi?id=55691 this conversation].
 +
*Attempted to set up remote desktop sharing through ssh, so far not really working:
 +
:% <code>krfb</code>
 +
:% <code>vncviewer localhost:5900
 +
:-Added XTEST(X11R6) to Exceed Xconfig under X Server Protocol, Extensions Tab
 +
 +
== CygWin ==
 +
*Installing minicom on cygwin:
 +
#Add folder: <code>/var/lock</code>
 +
#Move file <code>minirc.dfl</code> to <code>/usr/local/etc</code>
 +
#Fix serial port <code>/dev/ttyS1</code> -> <code>/dev/com1</code> ???
 +
 +
== Unix/Linux ==
 +
*[http://users.tkk.fi/~thyle/unix_opas.html Basic unix commands]
 +
*[http://www.indiana.edu/~uitspubs/b017/ Basic unix commands]
 +
*[http://www.tldp.org/LDP/abs/html/io-redirection.html IO-Redirection shell commands]
 +
*[http://www.debian.org/doc/manuals/users-guide/ch-rsi.en.html Linux command reference]
 +
*[http://www.cs.utah.edu/dept/old/texinfo/emacs19/emacs_toc.html Emacs manual]
 +
*[http://drumlin.thehutt.org/vi/ Vi manual]
 +
*[http://www.cs.utah.edu/dept/old/texinfo/gawk/gawk_toc.html Gawk manual]
 +
*[http://www.gnu.org/software/gawk/gawk.html GNU awk manual]
 +
*[http://www.cs.utah.edu/dept/old/texinfo/ GNU manuals from University of Utah]
 +
 +
 +
 +
=== 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.computerhope.com/unix/overview.htm Common Linux commands]
 +
*[http://linux.deadgod.net/2007/01/01/Special_Bash_Variables_I <code>history</code>]
 +
*count lines of code in a directory http://vision-media.ca/resources/unix/counting-lines-in-a-script
 +
:<code>find . -type f | xargs wc -l</code>
 +
:<code>find . -type f -name '*.c' | xargs wc -l</code> specific file type
 +
*<code>mount -o loop disk1.iso [/directory]</code> Mount an .iso file
 +
*To get information on the server/computer:
 +
:<code>cat /proc/cpuinfo</code>
 +
:<code>cat /proc/meminfo</code>
 +
:<code>dmesg</code>
 +
:<code>lspci</code> (list pci devices)
 +
:<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>pkill -U [UID]</code> Logoff user "UID"
 +
*<code>pgrep</code> looks through the currently running processes and lists the process IDs which matches the selection criteria to stdout.
 +
*<code>ifconfig</code> network/ip information | <code>/sbin/ifconfig</code> if not root
 +
*<code>sysctl kernel.hostname=NEW_HOSTNAME</code> to permanantly change hostname
 +
*<code>service network restart</code> restart network services
 +
*<code>find . -name "rc.conf" -print</code>
 +
*<code>xhost +[server name, i.e. vlsi]</code> (give permission to remote server to use local display)
 +
*<code>setenv DISPLAY=###.###.###.###:0.0</code> (set DISPLAY variable to local ip address)
 +
*<code>cat /var/log/messages |grep ***</code> (Search system messages for specific word)
 +
*<code>service xinetd restart</code> (Restart xinetd server)
 +
*<code>rpm -ivh foo-1.0-1.i386.rpm</code> (Add a package with rpm)
 +
*<code>rpm -e foo</code> (Remove a package with rpm)
 +
*<code>ps</code> (processes)
 +
*<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>md5sum [filename]</code> Generate md5 hash of [filename]
 +
*<code>ar -s</code> or <code>ranlib</code> add index to archive (.a) file
 +
 +
=== Software ===
 +
*[http://cloc.sourceforge.net/ cloc]: utility for counting lines of code
 +
*meld: compare and merge up to three files
 +
*yay: yet another YUV viewer
 +
:<code>%yay [-s <with>x<height>] <filename>.yuv</code>
 +
*mpeg4ip tools: toolbox for mp4, avi, mov, etc. (!!! Could only find executables for Windows !!!)
 +
:<code>%mp4info.exe [file.mp4]</code>
 +
:<code>%mp4creator -extract=1 file.avi file.264</code> (extract track number based on info given by <code>mp4info.exe</code>
 +
*gprof: gnu profiling software
 +
:<code>%gprof [executable] gmon.out > [gprof.out]</code>
 +
:<code>gmon.out</code> is generated by compiling target executable with -pg as a compiler and linker flag, then running the resulting executable normally
 +
*[http://mvertes.free.fr/cgprof/cgprof.html cgprof]: generate call-graph based on gprof data
 +
:<code>cgprof -T ps -g [gprof.out] [gprof.ps]</code> (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
 +
*<code>[http://www.gson.org/egypt/egypt.html egypt]</code> Create call graph from gcc's rtl dump
 +
*<code>links</code> text based browser
 +
 +
=== Drivers ===
 +
*[http://www.freesoftwaremagazine.com/articles/drivers_linux Short tutorial on writing drivers in linux]
 +
 +
== 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
 +
 +
== 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://ccrma.stanford.edu/planetccrma/man/man1/avr-nm.1.html nm] ===
 +
*<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 ===
 +
*[http://en.wikipedia.org/wiki/VNC VNC on Wikipedia]
 +
*[http://www.freebsddiary.org/tightvnc.php TightVNC information]
 +
*<code>vncserver :1 -geometry 1880x1160</code>
 +
*<code>vncviewer localhost:#</code> over ssh
 +
*<code>/etc/sysconfig/vncservers</code>
 +
*<code>/sbin/service vncserver restart</code>
 +
*<code>vncserver -kill :1</code>
 +
 +
=== grep ===
 +
*<code>grep -lir "[text]"</code> find file containing
 +
#<code>find . | xargs grep whatever</code> recursively find text starting from .
 +
 +
=== xev ===
 +
*Track interface signals such as key presses and mouse movement
 +
 +
=== Bootloader ===
 +
*[http://www.freesoftwaremagazine.com/articles/grub_intro/ Grub tips and tricks (USB installation)]
 +
 +
=== USBNET (USBDNET) ===
 +
*[http://www.linux-usb.org/usbnet/ usbnet driver information (linux-usb.org)]
 +
:-BLOB requires cdc_subset module (<code># modprobe cdc_subset</code>)
 +
*[http://www.linux-usb.org/gadget/index.html gadget driver information (linux-usb.org)]
 +
*[https://www.redhat.com/archives/fedora-list/2005-March/msg04044.html remove linux 2.6 usb 2.0 driver?] <code>modprobe -r ehci-hcd</code>
 +
:-apparently <code>uhci-hcd</code> is the usb 1.0 driver from linux 2.4
 +
*[http://handhelds.org/moin/moin.cgi/UsbNet Setting up usbnet (Fedora Core 4)]
 +
*[http://handhelds.org/moin/moin.cgi/WindowsXpUsbNetworkHowTo usbnet for Windows]
 +
 +
=== public key authentication ===
 +
*[http://blogs.sun.com/jkini/entry/how_to_scp_scp_and How to set up public/private key to perform file transfers without providing password every time]
 +
 +
=== scp ===
 +
*[http://community.activestate.com/forum-topic/svn-ssh-mac-os-x-and-password-prompts Information on ssh-agent for public key authentication]
 +
 +
=== rsync ===
 +
*[http://www.linux.com/feature/113847 Making secure remote backups with Rsync]
 +
*<code>rsync -avz -e ssh ~/source/ user@host:~/destination/</code>
 +
 +
=== sed ===
 +
*[http://www.grymoire.com/Unix/Sed.html Tutorial]
 +
*[http://www.moxleystratton.com/articles/rename-files-bash File renaming]:
 +
:<code>ls *old|sed 's/\(.*\)\.old/mv \1.old  \1.new/'|sh</code>
 +
 +
=== TFTP ===
 +
*[http://www.livibetter.com/blog/2007/06/14/installing-tftp-on-fedora/ Installing tftp on Fedora 6]
 +
*[http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch16_:_Telnet,_TFTP,_and_xinetd tftp instructions]
 +
 +
=== Compilers ===
 
*[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]
 +
==== gcc ====
 +
*[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://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://blog.flameeyes.eu/2008/01/17/today-how-to-identify-unused-exported-functions-and-variables Information on -Wl,--gc-sections linker option]
 +
 +
==== XLC ====
 +
*[http://www-01.ibm.com/software/awdtools/xlcpp/multicore/library/ XLC references]
 +
 +
=== 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://www.gnu.org/software/make/manual/make.html Make manual]
 +
*[http://makepp.sourceforge.net/1.19/makepp_statements.html Various Make statements]
 +
*[http://www.cprogramming.com/tutorial/makefiles_continued.html Advanced Makefile reference]
 +
 +
== [[Fedora Red Hat Enterprise Linux]] (RHEL) ==
 +
*[http://fedoraproject.org/wiki/FedoraLiveCD/USBHowTo Create bootable USB drive using Fedora script]
 +
*[http://www.livibetter.com/blog/2007/06/14/installing-tftp-on-fedora/ Installing tftp on Fedora]
 +
*[http://fr.rpmfind.net/linux/RPM/Dag_Apt_Repository_for_Fedora_Core_1.html Fedora Core 1 Repository]
 +
*[http://www.redhat.com/docs/manuals/linux/RHL-7-Manual/ref-guide/s1-rpm-using.html Using rpm]

Latest revision as of 01:55, 29 December 2010

Fedora 9

Fedora 7

Add user:

  • /sbin/adduser username
  • passwd username

Add user to sudo list:

  • echo 'loginname ALL=(ALL) ALL' >> /etc/sudoers Where '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 folder Recursively change owner and group of folder
  • init [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

  • startkde start KDE (from ssh)
  • Added xset r off to .bashrc hopefully 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:
  1. Add folder: <code>/var/lock
  2. Move file minirc.dfl to /usr/local/etc
  3. Fix serial port /dev/ttyS1 -> /dev/com1 ???

Unix/Linux


Command Line

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

  • Bluefish is a powerful editor targeted towards programmers and webdesigners, with many options to write websites, scripts and programming code.

cron

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
  1. 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)
-apparently uhci-hcd is the usb 1.0 driver from linux 2.4

public key authentication

scp

rsync

sed

ls *old|sed 's/\(.*\)\.old/mv \1.old \1.new/'|sh

TFTP

Compilers

gcc

XLC

Make

Fedora Red Hat Enterprise Linux (RHEL)