Maintenance reference: Difference between revisions
No edit summary |
No edit summary |
||
Line 30: | Line 30: | ||
! script favs | ! script favs | ||
|- | |- | ||
COMMANDS WORTH REMEMBERING | |||
My scripts: | |||
sc show most-common quick-scripts | |||
greplogs blah search all my log files (named ToDo.txt) for "blah" | |||
greplogs blah -C 3 search all my log files (named ToDo.txt), and show 3 surrounding lines of context | |||
grepcode blah -C 3 same, but search code files underneath the current dir (h|hpp|cpp|pl|php) | |||
restart_process_as_needed.pl name=#path/file# | |||
checks for process named 'file'; if not found, starts path/file | |||
pk substring prompt to kill all processes with 'substring' | |||
General-purpose: | |||
cp -axv drive drive_backup clone an unmounted linux system | |||
ps ax|grep blah show running processes with "blah" in them | |||
lsof -c cp show open files for any process starting with "cp" | |||
lspci list all the hardware using the PCI bus (video cards, etc) | |||
watch #command# repeat the command every 2 secs (default), showing output | |||
tail -f #logfile# display the tail end of the logfile, in realtime | |||
shutdown -rF now reboot, forcing an fsck on startup (or, put a [forcefsck] file in drive root) | |||
fuser -m /dev/hdb1 find open files on a drive, then processes that have the file(s) open | |||
/dev/hdb1: 538 | |||
ps auxw|grep 538 | |||
donncha 538 0.4 2.7 219212 56792 ? SLl Feb11 11:25 rhythmbox | |||
wc -l file count lines - can pipe to it too | |||
find / -name "libjpeg*" brute-force find (in this case, all libraries starting with jpeg...) | |||
iostat -dx 5 report on drive % utilization etc ("emerge systat" to get it) | |||
iotop top for io, of course | |||
hdparm -t /dev/sda tests actual speed of hard drive | |||
Ubuntu-specific: | |||
xrandr --output DVI-I-2 --off && xrandr --output DVI-I-2 --auto --right-of DVI-I-1 fixes lost monitor, also try arandr | |||
sudo software-center [XXX.deb] to go to software center; specify a deb file to install (steam etc). | |||
sudo unity-control-center all settings; also a pathway to upgrading and selecting nvidia driver | |||
Gentoo-specific (see [http://news.thedigitalmachine.com/category/chatter/gentoo-notes/ blog] for USE flag notes): | |||
elogviewer X app to list installed packages including installation notes | |||
genlop -lu show the history of merged and unmerged packages | |||
eix #search# search for all packages (available AND installed) | |||
eix --world -c condensed list of all packages in your [world] | |||
emerge -Davu blah emerge package blah (if needed), confirming first | |||
dispatch-conf handles updating of config files after emerge, see /etc/dispatch-conf.conf | |||
equery uses #package# show USE flags of package | |||
equery depends #pkg# show packages that depend on package | |||
equery belongs #file# show the package to which the file belongs | |||
equery hasuse #flag# shows packages that have the USE flag | |||
equery depgraph --depth=# #pkg# shows the entire dependency tree for pkg | |||
eix-sync grabs latest package list, updates portage and eix (usually called via cron) | |||
emerge --emptytree --update world CAREFUL, this reinstalls EVERYTHING :> | |||
Apps: | |||
alsamixer set 7.1-channel HD audio volume levels | |||
alsa-config test, set optimal audio levels | |||
mythfilldatabase fill TV listings database | |||
For development: | |||
git rebase --hard HEAD throw away your local changes that have not yet been committed | |||
git rebase --hard master force the current branch to match master (losing ALL commits!) | |||
cvs history -c [file] get list of revisions for [file] | |||
cvs diff -r 1.2 [file] compare past revision to current | |||
cvs diff -r 1.3 -r 1.2 [file] compare two revisions | |||
| Run sc to get the latest list: | | Run sc to get the latest list: | ||
----------------------------------------------- | ----------------------------------------------- |
Revision as of 16:55, 1 November 2015
general | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
blog for USE flag notes):
elogviewer X app to list installed packages including installation notes
genlop -lu show the history of merged and unmerged packages
eix #search# search for all packages (available AND installed)
eix --world -c condensed list of all packages in your [world]
emerge -Davu blah emerge package blah (if needed), confirming first
dispatch-conf handles updating of config files after emerge, see /etc/dispatch-conf.conf
equery uses #package# show USE flags of package
equery depends #pkg# show packages that depend on package
equery belongs #file# show the package to which the file belongs
equery hasuse #flag# shows packages that have the USE flag
equery depgraph --depth=# #pkg# shows the entire dependency tree for pkg
eix-sync grabs latest package list, updates portage and eix (usually called via cron)
emerge --emptytree --update world CAREFUL, this reinstalls EVERYTHING :>
Apps:
alsamixer set 7.1-channel HD audio volume levels
alsa-config test, set optimal audio levels
mythfilldatabase fill TV listings database
For development:
git rebase --hard HEAD throw away your local changes that have not yet been committed
git rebase --hard master force the current branch to match master (losing ALL commits!)
cvs history -c [file] get list of revisions for [file]
cvs diff -r 1.2 [file] compare past revision to current
cvs diff -r 1.3 -r 1.2 [file] compare two revisions
|
Ubuntu | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
OpenELEC | ||||
---|---|---|---|---|
|
gentoo | ||
---|---|---|
|
Windows | ||||||
---|---|---|---|---|---|---|
|
Boxes | |||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|