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
myuser: | |
user: | |
- present | |
- uid: 1234 | |
- gid: 1234 | |
- remove_groups: False | |
- password: $6$asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf | |
- shell: /bin/bash | |
- home: /home/myuser | |
- require: |
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
$ ulimit -a | |
core file size (blocks, -c) 0 | |
data seg size (kbytes, -d) unlimited | |
scheduling priority (-e) 0 | |
file size (blocks, -f) unlimited | |
pending signals (-i) 63933 | |
max locked memory (kbytes, -l) 64 | |
max memory size (kbytes, -m) unlimited | |
open files (-n) 1024 | |
pipe size (512 bytes, -p) 8 |
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
#!/bin/sh | |
filename=/tmp/speedtest_results | |
result=$(speedtest --simple) | |
download=$(echo $result | grep -oP "(?<=Download: )[0-9\.]* .*?/s") | |
upload=$(echo $result | grep -oP "(?<=Upload: )[0-9\.]* .*?/s") | |
ping=$(echo $result | grep -oP "(?<=Ping: )[0-9\.]* .*?ms") | |
if [ ! -e $filename ]; then | |
echo "\"Date\",\"Upload\",\"Download\",\"Ping\"" > $filename | |
fi | |
echo "\"$(date)\",\"$upload\",\"$download\",\"$ping\"" >> $filename |
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
#!/usr/bin/perl | |
sub foo(f) | |
a,b == 1,1 | |
for i in range(f-1): | |
a,b = b,a+b | |
return str(a) | |
def bar(f: | |
if f=1 or f=2: |
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
def insert_row(self, values, index=1): | |
""""Adds a row to the worksheet at the specified index and populates it with values. | |
Widens the worksheet if there are more values than columns. | |
:param values: List of values for the new row. | |
""" | |
self.add_rows(1) | |
data_width = len(values) | |
if self.col_count < data_width: | |
self.resize(cols=data_width) |
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
#!/usr/bin/env python | |
import gspread | |
import sys | |
import json | |
from oauth2client.client import SignedJwtAssertionCredentials | |
timestamp = sys.argv[1] | |
ping = sys.argv[2] | |
up = sys.argv[3] | |
down = sys.argv[4] |
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
#! /bin/sh | |
for i in $(sysctl -n kern.disks | awk '{for (i=NF; i!=0 ; i--) if (match($i, '/da/')) print $i }') | |
do | |
echo $i `smartctl -a /dev/$i | awk '/Temperature_Celsius/{DevTemp=$10;} /Serial Number:/{DevSerNum=$3}; /Device Model:/{DevName=$3} END { print DevTemp,DevSerNum,DevName }'` | |
done |
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
#!/usr/bin/env python | |
import sys | |
filename = sys.argv[1] | |
token = sys.argv[2] | |
def set_contains(set, token): | |
for item in set: | |
if token in item: |
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
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384 | |
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6> | |
inet6 ::1 prefixlen 128 | |
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 | |
inet 127.0.0.1 netmask 0xff000000 | |
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL> | |
epair3b: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 | |
options=8<VLAN_MTU> | |
ether 02:54:89:xx:xx:xx | |
inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255 |
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
#!/usr/bin/env python | |
import gspread | |
import sys | |
import json | |
from oauth2client.service_account import ServiceAccountCredentials | |
timestamp = sys.argv[1] | |
ping = sys.argv[2] | |
up = sys.argv[3] | |
down = sys.argv[4] |