Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # /\/| ___ _ _ _
- # |/\/ / / | | | | (_)
- # / /| |__ __ _ ___| |__ __ | |_ __ _ ___ ___ ___
- # / / | '_ \ / _` / __| '_ \ / _` | | |/ _` / __|/ _ \/ __|
- # / / | |_) | (_| \__ \ | | | ____ | (_| | | | (_| \__ \ __/\__ \
- # /_(_) |_.__/ \__,_|___/_| |_||____| \__,_|_|_|\__,_|___/\___||___/
- # 2016-02-12 11:08:30 (Friday February 12 2016 NZDT +1300)
- # Add an SSH key to ssh-agent
- 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:")'
- # Print the current CPU frequency in Hz
- 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'
- # Print the current CPU temperature in degrees Celcius
- 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'
- # Create an initramfs based on the current kernel version
- 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:")'
- # Create a strong and uniquely identifiable ssh key
- 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:")'
- # Update the current firmware installation from the 'master' branch
- 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:")'
- # Update the current firmware installation from the 'next' branch
- 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:")'
- # Perform a full system upgrade and clean up unused packages and old installation files
- 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:")'
- # Reboot the system
- alias reboot-now='echo -en "Rebooting system now... \n" ; sudo shutdown -r now'
- # Restart the system
- alias restart-now='echo -en "Restarting system now... \n" ; sudo shutdown -r now'
- # Restart the SSH service
- 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"'
- # Restart the wireless service wlan0
- 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"'
- # Shut down the system
- alias shutdown-now='echo -en "Shutting down system now... \n" ; sudo shutdown -h now'
- # Extract a tar archive
- 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