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 | |
# | |
# Script for periodically (default: 10m) check a web page for a keyword | |
# | |
# Gist: | |
# https://gist.github.com/ps1dr3x/5a5697ea2d37d06a34fdb38ef36050d4 | |
# | |
# Usage: | |
# check-for-page-keyword.sh host keyword [seconds] | |
# |
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
# Location of openssl.cnf might be different | |
openssl req -new -newkey rsa:4096 -x509 -sha256 -days 3650 -nodes \ | |
-subj "/C=IT/ST=BO/L=Bologna/O=Aperture Science SRL/CN=example.com" \ | |
-extensions SAN \ | |
-config <(cat /etc/ssl/openssl.cnf \ | |
<(printf "\n[SAN]\nsubjectAltName=DNS:www.example.com,DNS:sub.example.com,IP:123.123.123.123")) \ | |
-out example.crt -keyout example.key |
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
Append this lines to /etc/security/limits.conf | |
* hard nofile 500000 | |
* soft nofile 500000 | |
root hard nofile 500000 | |
root soft nofile 500000 | |
Log-out and log-in and check new limits | |
Hard: |
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
swapoff -a | |
fdisk /dev/xxx | |
# delete partitions partitionX + swap (d) | |
# create new primary partitions partitionX + swap (n + p) with the new size | |
# change parititon type (t) partitionX -> 83, swap -> 82 | |
# add bootable flag (a) partitionX | |
# write changes (w) | |
partprobe |
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
### Keybase proof | |
I hereby claim: | |
* I am ps1dr3x on github. | |
* I am ps1dr3x (https://keybase.io/ps1dr3x) on keybase. | |
* I have a public key ASAOMSkZS9IQcvRUMI58e-PMjmISJnxJepn4rY8KYj3-_wo | |
To claim this, I am signing this object: |
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
# Remove all containers | |
docker rm $(docker ps -aq) | |
# Remove dangling images | |
docker rmi $(docker images -q -f dangling=true) | |
# Remove all images | |
docker rmi $(docker images -aq) | |
# Remove all the unused volumes |
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
[Unit] | |
Description=Set the battery charge threshold | |
After=multi-user.target | |
StartLimitBurst=3 | |
StartLimitIntervalSec=300s | |
[Service] | |
Type=oneshot | |
Restart=on-failure | |
ExecStart=/bin/bash -c 'echo 80 > /sys/class/power_supply/BAT0/charge_control_end_threshold' |
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/bash | |
# Speedtest using DigitalOcean's data centers | |
wget -O /dev/null http://speedtest-nyc1.digitalocean.com/1gb.test | |
# or 100mb | |
# wget -O /dev/null http://speedtest-nyc1.digitalocean.com/100mb.test | |
# Locations (1-x): | |
# nyc, sfo, ams, lon, fra, sgp, tor, blr |
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/bash | |
# Don't forget to chmod +x update-dynhost-ovh.sh and add the cron | |
# */5 * * * * update-dynhost-ovh.sh | |
DOMAIN="" | |
USERNAME="" | |
PASSWORD="" | |
LOG_FILE="/var/log/update-dyndns-ovh.log" |
OlderNewer