Fulltext results:
- Cleanup Packages @info:linux:debian
- ut not purged) packages with this command: <code bash> dpkg --get-selections | grep 'deinstall$' </code... irectly to aptitude to purge the packages: <code bash> aptitude purge $(dpkg --get-selections | grep 'd... First, you have to install ''deborpan'': <code bash> aptitude install deborphan </code> Then you can get the list of orphans: <code bash> deborphan </code> If you want, you can even mor
- localeadm @info:solaris
- nt it (insert your path in the first line. <code bash> ISOIMG="/share/iso/sol-10-u8-ga-sparc-dvd.iso" L... ote: If you're using the bourne shell (instead of bash or ksh), then use backticks in the second line: '... es ===== ==== List Installed Locales ==== <code bash> localeadm -lc </code> Example output: <code> C... /code> ==== List Installable Locales ==== <code bash> localeadm -lc -d /mnt/Solaris_10/Product </code>
- root login with bash @info:script
- ====== root login with bash ====== On our systems, the ''root'' account is set to be a role, so you can... urne shell (''/bin/sh''), but working with ''/bin/bash'' is much easier. Using this command, you can directly log in as ''root'' with a ''bash'' shell. ssh demo.lab.example.com -t "su - root -c /bin/bash"' I set it up as an alias in ''.bashrc'': ali
- rmdir for OSX @info:mac
- es from the command line quite complicated: <code bash> $ rmdir test rmdir: test: Directory not empty $ ... Store $ /bin/rmdir test </code> I wrote a small bash function to remove directories together with the contained ''.DS_Store'' file: <code bash> rmdir() { for d in "$@" do f="${d%/}/.DS_Store"... ction you can remove the directory at once: <code bash> $ rmdir test removing test/.DS_Store </code> {{
- DynDNS Updates without a Client @info:script
- lient for my OpenSolaris Home Server, but a small bash script does the job as good as any other client. <code bash dyndns-update.sh> #! /bin/bash . ${HOME}/.dyndns.cfg DOMAINS=$(cat ${HOME}/.dyndns.domains) echo "$... yndns.cfg''. Here an example config file: <file bash dyndns.cfg> LOGIN="jdoe:secret" UPDATE_URL="http:
- Disable a Service @info:linux:debian
- le a Service ====== To disable a service: <code bash> service <service> stop update-rc.d <service> ena... With ''systemd'' (starting with Debian 8): <code bash> systemctl disable <service> </code> To (re)enable a service: <code bash> update-rc.d <service> enable|disable service <se... With ''systemd'' (starting with Debian 8): <code bash> systemctl enable <service> </code> {{tag>linux
- MacPorts @info:mac
- === List Ports ===== list requested ports: <code bash> port echo requested | cut -d ' ' -f 1 | uniq </code> list installed ports: <code bash> port -qv installed </code> ===== Housekeeping =... You can see a list of all installed ports: <code bash> port echo installed </code> After you run MacPo... ot of duplicate ports. You can clean these: <code bash> sudo port uninstall inactive </code> {{tag>admi
- Setting the Timezone @info:linux:debian
- imezone''. ===== Check the Timezone ===== <code bash> cat /etc/timezone </code> Example: <code> # ca... et the Timezone ===== You can use ''vi'': <code bash> vi /etc/timezone </code> Or set it directy: <code bash> echo "Europe/Berlin" > /etc/timezone </code> {{
- Compare directories @info:script
- f the directories, generate a digest file: <code bash> find DIR -type f -exec shasum {} + | LC_ALL=C so... er that, you can diff the two shasums.txt: <code bash> diff shasums1.txt shasums2.txt </code> Or you use Meld as graphical diff tool: <code bash> meld shasums1.txt shasums2.txt </code> {{tags>c
- Shell Script Variables @info:script
- er ===== Get the last character of ''$a'': <code bash> ${a: -1} </code> ===== Remove Slash from the En... ===== Remove a trailing slash from ''$a'': <code bash> a=${a%/} </code> {{tag>scripting bash sysadmin variable}}
- Android Backup @info:android
- y insert the current date in the filename: <code bash> adb backup -apk -shared -all -f $(date '+%Y-%m-%... ), check the listing of connected devices: <code bash> adb devices </code> Which may result in a listi... n solve this by restarting the adb server: <code bash> sudo adb kill-server sudo adb start-server </cod
- Oracle: Recovery Manager @info:oracle
- ====== ===== Start Recovery Manager ===== <code bash> rman target / </code> ===== Delete Archive Logs... ting all logs except the last three days): <code bash> #!/bin/bash . ${HOME}/.profile rman target / << __EOF__ DELETE NOPROMPT ARCHIVELOG ALL COMPLETED B
- Command Line Audio @info:mac
- e from the command line]]. It's as easy as <code bash> sudo osascript -e "set Volume 10" </code> You c... ommand line audio player]]. You just enter <code bash> afplay file.wav </code> More information on how
- MySQL: Backup @info:mysql:database
- ckup ====== ===== Export a Database ===== <code bash> # set or replace the variables $USER, $PASS and ... == Export all Databases individually ===== <code bash> # set or replace the variables $USER and $PASS D
- List Open Ports @info:sysadmin
- rts together with the listening processes: <code bash> netstat -tulpn </code> Here is an example outpu