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 bash | |
set -euxo pipefail | |
sudo iptables -P INPUT ACCEPT | |
sudo iptables -P OUTPUT ACCEPT | |
sudo iptables -P FORWARD ACCEPT | |
sudo iptables -F | |
sudo netfilter-persistent save |
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/python | |
# -*- coding: utf-8 -*- | |
# | |
# mdns-publish-cname - Publish CNAMEs pointing to the local host over Avahi/mDNS. | |
# | |
# Copyright (c) 2018, Carlos Rodrigues | |
# | |
from mpublisher import cname_service as command |
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 bash | |
set -euxo pipefail | |
export "${GH_USERNAME:=andyfangdz}" | |
mkdir -p ~/.ssh && chmod 0700 ~/.ssh | |
curl -L https://github.com/${GH_USERNAME}.keys > ~/.ssh/authorized_keys | |
chmod 0600 ~/.ssh/authorized_keys |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
shouldComponentUpdate(nextProps, nextState) { | |
for (let key in this.props) { | |
if (this.props[key] !== nextProps[key]) { | |
console.log(key); | |
} | |
} | |
return true; | |
} |
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 bash | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
NC='\033[0m' | |
filename='sha256.txt' | |
i=0 | |
matches=0 |
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 | |
#renew ssl letsencrypt certificate on bitnami server | |
#https://gist.github.com/printminion/6ec2fc0fefaba8e0a98a63a6d73b0802/edit | |
sudo /opt/bitnami/ctlscript.sh stop apache | |
cd /home/user/certbot | |
#./certbot-auto certonly --standalone -w /opt/bitnami/apache2/conf/ -d example | |
.com -d www.example.com | |
./certbot-auto renew | |
sudo cp /etc/letsencrypt/live/example.com/fullchain.pem /opt/bitnami/apache2/conf/server.crt |
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
{"0.3282184049900676":"-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nCharset: UTF-8\r\n\r\nxv8AAABSBAAAAAATCCqGSM49AwEHAgMEZ9dZIcdTuD2iYztXXWKak1+m0mmKepDB\r\nLiMn/jCV+gaPXSJaqMjuWg8ZwPO3Tudxz6m83UZxFZbJzgIWBiAj9M3/AAAACDxn\r\naXRodWI+wv8AAACOBBATCABA/wAAAAWCWHbxav8AAAACiwn/AAAACZAKedZc34A1\r\nwf8AAAAFlQgJCgv/AAAABJYDAQL/AAAAApsD/wAAAAKeAQAAW80A+gP9If8TLM2i\r\nN4ImviM+iv/42InuTszXIN6sCPoot+ViAQD9OBU7ksN+qrELsRnxRUKQwvVWZFla\r\nNamYrgyDJdmIgM7/AAAAVgQAAAAAEggqhkjOPQMBBwIDBFpe6NdAnGQM7omrXa/V\r\nnon6Ei/3qwOjEoSigfISq0p6vRrayLklG5zD7Av0R5UEVNRvdBUm+9t1H0C+i6V5\r\n52wDAQgHwv8AAABtBBgTCAAf/wAAAAWCWHbxav8AAAAJkAp51lzfgDXB/wAAAAKb\r\nDAAAOagBAO5toztpe+yYNroJxtYkS44sm2s38GDmq9syOSiAiwCRAP4zY5+4ffSP\r\nSJ+INYfrnm5MQaE57VSNuPgL/Of0tIkbBg==\r\n=9tzH\r\n-----END PGP PUBLIC KEY BLOCK-----\r\n","0.869156458975378":"-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nCharset: UTF-8\r\n\r\nxv8AAABSBAAAAAATCCqGSM49AwEHAgMEzPBEni1uye+HSKGiVMbt7oX2bl4a93ZL\r\n8Iol9en8hefP1MVElMKPEY2rqOI/Dn8drzIQWWL+o51MzC2WiMxJr83/AAAACDxn\r\naXRodWI+wv8AAACOBBA |
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 safe_get(_dict, _key, _type): | |
val = _dict.get(_key, None) | |
try: | |
return _type(val) | |
except TypeError: | |
return _type() |
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 DFS(depth=0, state=None): | |
if check_state_is_valid(depth, state): | |
report_found(state) | |
if depth >= target_depth: | |
return | |
for next_step in possible_steps(depth, state): | |
current_state = state | |
apply_step_on_state(next_step, state) |
NewerOlder