-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
54414a6
commit c00e40b
Showing
15 changed files
with
189 additions
and
3 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
NIC=eth0 | ||
if [ "$1" != "" ]; then | ||
NIC=$1 | ||
fi | ||
TIME=5 | ||
if [ "$2" != "" ]; then | ||
TIME=$2 | ||
fi | ||
ethtool -p $NIC $TIME |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
DOMAIN=$1 | ||
echo | openssl s_client -connect $DOMAIN:443 2>/dev/null | openssl x509 -dates -noout |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
PORT=8000 | ||
if [ "$1" != "" ]; then | ||
PORT=$1 | ||
fi | ||
python3 -m http.server $PORT |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
LEN=16 | ||
if [ "$1" != "" ]; then | ||
LEN=$1 | ||
fi | ||
head -n 1 /dev/urandom | base64 | grep -o '[[:alnum:]]' | head -n $LEN | tr -d '\n' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
GIT_COMMITTER_DATE="$1" git commit --amend --no-edit --date "$1" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
git commit -m "$(curl -s http://whatthecommit.com/index.txt)" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
mkdir /tmp/utils-installer | ||
cd /tmp/utils-installer | ||
wget https://github.com/fabiocicerchia/utils/archive/master.zip | ||
unzip master.zip && rm master.zip | ||
cd utils-master/ | ||
rm installer *.* | ||
cd /tmp/utils-installer/utils-master /opt/utils-master | ||
echo "PATH=\$PATH:/opt/utils-master" | tee -a /etc/profile |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
curl "http://ip-api.com/line/$1?fields=country,countryCode,city" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
curl ifconfig.me |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
FILE=$1 | ||
pdf2ps $FILE $FILE.ps && ps2pdf $FILE.ps $FILE && rm $FILE.ps |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/sh | ||
IS_NIX=$(which free) | ||
echo "Arch: $(arch)" | ||
if [ $IS_NIX ]; then | ||
echo "CPU: $(nproc 2> /dev/null)" | ||
echo "RAM: $(free -m 2> /dev/null | grep Mem | awk '{print $2}') MB" | ||
echo "Swap: $(free -m 2> /dev/null | grep Swap | awk '{print $2}') MB" | ||
else | ||
echo "CPU: $(sysctl -n hw.physicalcpu)" | ||
echo "RAM: $(echo $(($(sysctl -n hw.memsize) / 1024 / 1024))) MB" | ||
echo "Swap: $(sysctl vm.swapusage | awk '{print $4}' | sed 's/\..*//') MB" | ||
fi | ||
|
||
echo "Disk: $(df -h / | tail -n1 | awk '{print $3}')" | ||
echo "Avg load: $(uptime | sed 's/.*: //')" | ||
if [ $IS_NIX ]; then | ||
echo "IP Private: $(ip addr show eth0 | grep "inet\b" | head -n1 | awk '{print $2}' | cut -d/ -f1)" | ||
else | ||
echo "IP Private: $(ifconfig en0 | grep "inet\b" | head -n1 | awk '{print $2}' | cut -d/ -f1)" | ||
fi | ||
|
||
IP=$(curl -s ifconfig.me) | ||
echo "IP Public: $IP" | ||
echo "Location: $(curl -s http://ip-api.com/line/$IP?fields=country)" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
unset HISTFILE |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
TIME=$1 | ||
date -d@$TIME 2> /dev/null || date -r $TIME |