This file contains hidden or 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
pem2openpgp "Name Surname <email@something>" < mykey.pem | gpg --import |
This file contains hidden or 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
# host | |
apt-get install apt-cacher-ng | |
# dockerfile | |
ARG APT_CACHE | |
RUN [ ! -z "$APT_CACHE" ] && echo "Acquire::http::Proxy \"http://$APT_CACHE\";" > /etc/apt/apt.conf.d/30proxy ||: | |
# docker build | |
docker build --build-arg APT_CACHE=$HOST_IP:3142 . |
This file contains hidden or 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
echo -n " cgroup_memory=1 swapaccount=1" >> /boot/cmdline.txt |
This file contains hidden or 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
vi /etc/sudoers.d/nopasswd | |
%sudo ALL = (ALL) NOPASSWD: ALL |
This file contains hidden or 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
vi /var/lib/polkit-1/localauthority/50-local.d/disable-passwords.pkla | |
[Do anything you want] | |
Identity=unix-group:sudo | |
Action=* | |
ResultActive=yes |
This file contains hidden or 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
dictget = lambda d, *k: [d[i] for i in k] | |
''' | |
usage: v1, v2, vN = dictget(<dict>, 'key1', 'key2', 'keyN') | |
''' |
This file contains hidden or 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/python | |
import json | |
from HTMLParser import HTMLParser | |
class MyHTMLParser(HTMLParser): | |
def __init__(self): | |
HTMLParser.__init__(self) | |
self.on_dt = False | |
self.on_dd = False |
This file contains hidden or 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
from uphold import Uphold | |
from time import sleep, time | |
from tinydb import TinyDB | |
api = Uphold() | |
api.auth_pat(<PAT_KEY>) | |
db = TinyDB('/tmp/db.json') | |
usd_card = <USD_CARD_ID> |
This file contains hidden or 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
sudo apt-get install curl | |
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - | |
sudo apt-get install -y nodejs | |
curl -L https://www.npmjs.org/install.sh | sudo sh |
This file contains hidden or 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
{} |