Guest User

~/.bash_aliases

a guest
Feb 11th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.87 KB | None | 0 0
  1. # /\/| ___ _ _ _
  2. # |/\/ / / | | | | (_)
  3. # / /| |__ __ _ ___| |__ __ | |_ __ _ ___ ___ ___
  4. # / / | '_ \ / _` / __| '_ \ / _` | | |/ _` / __|/ _ \/ __|
  5. # / / | |_) | (_| \__ \ | | | ____ | (_| | | | (_| \__ \ __/\__ \
  6. # /_(_) |_.__/ \__,_|___/_| |_||____| \__,_|_|_|\__,_|___/\___||___/
  7.  
  8. # 2016-02-12 11:08:30 (Friday February 12 2016 NZDT +1300)
  9.  
  10. # Add an SSH key to ssh-agent
  11. alias add-ssh-key='time (echo -en "Adding ssh key to ssh-agent now... \n" ; echo -en "Starting ssh-agent... \n" ; eval `ssh-agent -s` ; echo -en "Adding ssh key... \n" ; ssh-add ; echo -en "Done \n\n" ; echo "Total elapsed time:")'
  12.  
  13. # Print the current CPU frequency in Hz
  14. alias cpu-freq='echo -en "Reporting CPU frequency now... \n" ; echo -en "CPU Frequency (Hz): " ; cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq'
  15.  
  16. # Print the current CPU temperature in degrees Celcius
  17. alias cpu-temp='echo -en "Reporting CPU temperature now... \n" ; echo -en "CPU Temperature (C): " ; cat /sys/class/thermal/thermal_zone0/temp | cut -c1-2'
  18.  
  19. # Create an initramfs based on the current kernel version
  20. alias create-initramfs='time (echo -en "Generating new initramfs... \n"; sudo /etc/kernel/postinst.d/initramfs-tools $(uname -r) ; echo -en "Done \n\n" ; echo "Total elapsed time:")'
  21.  
  22. # Create a strong and uniquely identifiable ssh key
  23. alias create-ssh-key='time (echo -en "Generating ssh key now... \n" ; ssh-keygen -b 8192 -o -v -C "$(whoami)@$(hostname)-$(date +"%F %T (%A %B %d %Y %Z %z)")" ; echo -en "Done \n\n" ; echo "Total elapsed time:")'
  24.  
  25. # Update the current firmware installation from the 'master' branch
  26. alias do-firmware-upgrade-master='time (echo -en "Doing a firmware upgrade now... \n" ; echo -en "Updating firmware and kernel to the 'master' branch using rpi-update now... \n" ; sudo BRANCH=master rpi-update ; echo -en "Done \n\n" ; echo "Total elapsed time:")'
  27.  
  28. # Update the current firmware installation from the 'next' branch
  29. alias do-firmware-upgrade-next='time (echo -en "Doing a firmware upgrade now... \n" ; echo -en "Updating firmware and kernel to the 'next' branch using rpi-update now... \n" ; sudo BRANCH=next rpi-update ; echo -en "Done \n\n" ; echo "Total elapsed time:")'
  30.  
  31. # Perform a full system upgrade and clean up unused packages and old installation files
  32. alias do-system-upgrade='time (echo -en "Doing a full system upgrade now... \n" ; echo -en "Updating sources now... \n" ; sudo apt-get update ; echo -en "Done \n" ; echo -en "Upgrading the system now... \n" ; sudo apt-get dist-upgrade ; echo -en "Done \n" ; echo -en "Removing packages that are no longer required by the system now... \n" ; sudo apt-get autoremove ; echo -en "Done \n" ; echo -en "Removing downloaded packages now... \n" ; sudo apt-get autoclean ; echo -en "Done \n\n" ; echo "Total elapsed time:")'
  33.  
  34. # Reboot the system
  35. alias reboot-now='echo -en "Rebooting system now... \n" ; sudo shutdown -r now'
  36.  
  37. # Restart the system
  38. alias restart-now='echo -en "Restarting system now... \n" ; sudo shutdown -r now'
  39.  
  40. # Restart the SSH service
  41. alias restart-ssh='echo -en "Restarting ssh service now... \n" ; echo -en "Stopping ssh service now... \n" ; sudo service ssh stop ; echo -en "Done \n" ; echo -en "Starting ssh service now... \n" ; sudo service ssh start ; echo -en "Done \n"'
  42.  
  43. # Restart the wireless service wlan0
  44. alias restart-wlan0='echo -en "Restarting WLAN service now... \n" ; echo -en "Stopping wlan0... \n" ; sudo ip link set wlan0 down ; echo -en "Done \n" ; echo -en "Starting wlan0... \n" ; sudo ip link set wlan0 up ; echo -en "Done \n"'
  45.  
  46. # Shut down the system
  47. alias shutdown-now='echo -en "Shutting down system now... \n" ; sudo shutdown -h now'
  48.  
  49. # Extract a tar archive
  50. alias untar='time (echo -en "Extracting archive using tar now... \n" ; tar -xvzf ; echo -en "Done \n\n" ; echo "Total elapsed time:")'
Add Comment
Please, Sign In to add comment