Skip to content

Instantly share code, notes, and snippets.

View raphaelsoul's full-sized avatar
㊗️
Question: why it works? why it not works? why it works after I restart?

Dechen Zhuang raphaelsoul

㊗️
Question: why it works? why it not works? why it works after I restart?
  • China
View GitHub Profile
Update and upgrade the system
> sudo apt-get update -y && sudo apt-get upgrade -y
Security
> sudo ufw allow 22/tcp
> sudo ufw allow 8545/tcp
> sudo ufw allow 8545/udp
> sudo ufw allow 8546/tcp
> sudo ufw allow 8546/udp
> sudo ufw allow 30303/tcp
@raphaelsoul
raphaelsoul / gen_openssl_cert.sh
Created February 27, 2019 07:41
create a tls cert to protect docker API
openssl genrsa -aes256 -out ca-key.pem 4096
openssl req -new -x509 -days 3650 -key ca-key.pem -sha256 -out ca.pem
openssl genrsa -out server-key.pem 4096
openssl req -subj "/CN=YOUR_IP_ADDR" -sha256 -new -key server-key.pem -out server.csr
echo subjectAltName = DNS:YOUR_IP_ADDR,IP:YOUR_IP_ADDR,IP:127.0.0.1 > extfile.cnf
echo extendedKeyUsage = serverAuth >> extfile.cnf
@Artistan
Artistan / a ngrok_background.sh
Last active February 23, 2024 22:02 — forked from rjz/ngrok_hostname.sh
Get ngrok hostname from command line
#!/bin/sh
########################################################################################
# I do not need to use the ngrok subdomains...
# start ngrok for my local box (vagrant homestead) in th background
# get the cname from command line for the ngrok alias
# update my subdomain cname to point at new ngrok name
# use it!!!
########################################################################################
# requires ngrok and jq installed.
@MetalArend
MetalArend / swarm.yml
Last active November 18, 2024 01:43
Run a GitLab Runner on your Swarm
version: '3.4'
secrets:
# Find your registration token at: "Your project" > "Settings" > "CI/CD" > "Runners settings" > "Specific Runners" (look for registration token)
# Register it as `GITLAB_REGISTRATION_TOKEN`: `docker secret create GITLAB_REGISTRATION_TOKEN YOUR_REGISTRATION_TOKEN`
GITLAB_REGISTRATION_TOKEN:
external: true
# Find your personal access token at: "Your user account" > "Settings" > "Access Tokens" > "Create personal access token" (for api)
# Register it as `GITLAB_PERSONAL_ACCESS_TOKEN`: `docker secret create GITLAB_PERSONAL_ACCESS_TOKEN <YOUR ACCESS TOKEN>`
@ziwon
ziwon / phabricator.conf
Created January 4, 2017 08:18
Nginx Configuration for Phabricator
upstream php-phabricator-handler {
server unix:/run/php/php7.0-fpm.sock;
}
server {
listen 80;
server_name proj.felixlab.io;
return 301 https://$host$request_uri;
}
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@cshoe
cshoe / logging.py
Created May 23, 2012 20:55
Python dictConfig Logging
DEV_LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'basic': {
'format': '%(asctime)-6s: %(name)s - %(levelname)s - %(message)s',
}
},
'handlers': {
'console': {