Last active
May 30, 2018 17:33
-
-
Save rvdlee/27890012e18712be960da4778a1df607 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Encoding piped string | |
cat myexamplefile.txt | base64 | |
# Decoding piped string | |
cat mybase64encodedfile.txt | base64 -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# date +%s displays the current date in POSIX time format | |
# sha256 gets the checksum of this string | |
# base64 converts this to a base64 string | |
# head -c 64 gets the first 64 bytes of the piped content | |
# echo displays the manipulated string | |
date +%s | sha256sum | base64 | head -c 64 ; echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Login with SSH with an alternative port number | |
ssh user@domain.tld -p {port-number} | |
# Add a quoted commando to login, run the command and close the session | |
ssh user@domain.tld -p {port-number} 'ls -al' | |
# Copy a local file to the remote server with scp, this will copy to the home folder of user | |
scp -P {port-number} {local-file} user@domain.tld:~/{destination-file} | |
# Copy a remote file to local with scp, yet again home folder as target | |
scp -P {port-number} user@domain.tld:~/{remote-file} {local-directory} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# tr -cd will act as a filter for what characters we want to allow | |
# < /dev/urandom will echo the contents of the file to stdin | |
# head -c 64 gets the first 64 bytes of the piped content | |
# echo displays the manipulated string | |
tr -cd [:graph:] < /dev/urandom | head -c 64 ; echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a simple QR Code | |
qrencode -o qr-anything.png '#spreaditlikebutter' | |
# Create a "Setup my network QR Code" | |
# This will prompt for the SSID and WPA password | |
qrencode -s 7 -o qr-wifi.png "WIFI:S:$(zenity --entry --text="Network name (SSID)" --title="Create WiFi QR");T:WPA;P:$(zenity --password --title="Wifi Password");;" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment