Skip to content

Instantly share code, notes, and snippets.

Avatar

Crazygit crazygit

View GitHub Profile
@crazygit
crazygit / download.sh
Created Sep 14, 2020
Download Google Drive Files using wget
View download.sh
#!/usr/bin/env bash
# reffer:
# https://medium.com/@acpanjan/download-google-drive-files-using-wget-3c2c025a8b99
file_name="youer_file_name"
file_id="your_file_id"
confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate "https://docs.google.com/uc?export=download&id=${file_id}" -O-| sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=${confirm}&id=${field_id}" -O ${file_name} && rm -rf /tmp/cookies.txt
@crazygit
crazygit / install-dnsmasq-china-list-on-macos.sh
Last active Feb 17, 2020
Install dnsmasq-china-list on macos
View install-dnsmasq-china-list-on-macos.sh
#!/bin/bash
set -e
# install dnsmasq
brew install dnsmasq
WORKDIR="$(mktemp -d)"
SERVERS=(114.114.114.114 114.114.115.115 180.76.76.76)
# Not using best possible CDN pop: 1.2.4.8 210.2.4.8 223.5.5.5 223.6.6.6
# Dirty cache: 119.29.29.29 182.254.116.116
@crazygit
crazygit / cloudSettings
Last active Apr 30, 2020
VSCode Config Sync
View cloudSettings
{"lastUpload":"2020-04-30T06:41:57.209Z","extensionVersion":"v3.4.3"}
@crazygit
crazygit / generate_kubeconfig.sh
Created Jul 16, 2019
Create kubeconfig for service account in kubernetes
View generate_kubeconfig.sh
service_account_name="jenkins" # service account name, for example: jenkins
namespace="default" # service account namespace, for example: default
cluster_name="kubernetes"
server="https://kubernetes.default.svc.cluster.local"
ca_file="ca.crt"
kube_config_file="$service_account_name.conf"
token_name=$(kubectl get serviceaccount $service_account_name -n $namespace -o jsonpath="{.secrets[0].name}")
token=$(kubectl get secret $token_name -n $namespace -o jsonpath="{.data.token}" | base64 -D)
kubectl get secret $token_name -n $namespace -o jsonpath="{.data.ca\.crt}" | base64 -D > $ca_file
@crazygit
crazygit / AESCipher.java
Last active Oct 12, 2020
AES Python Android encrypt decrypt, more see: https://github.com/crazygit/AES-Encryption-Demo
View AESCipher.java
package com.example.anroid.testaescipher;
import android.util.Base64;
import java.io.UnsupportedEncodingException;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
@crazygit
crazygit / run_ss_client_with_http.sh
Last active Dec 15, 2018
run shadowsocks-libev client with docker, enable socket5 and http protocol
View run_ss_client_with_http.sh
#!/usr/bin/env bash
SERVER_ADDR="your_server_ip"
SERVER_PORT="your_server_port"
PASSWORD="your_password"
METHOD="your_encrption_method"
TIMEOUT=300
# socket5 协议端口1080
LOCAL_SCOKET_PORT=1080
@crazygit
crazygit / run_ss_client.sh
Last active Dec 15, 2018
run shadowsocks-libev client with docker
View run_ss_client.sh
#!/usr/bin/env bash
# 配置参考:
# https://github.com/shadowsocks/shadowsocks-libev/blob/master/docker/alpine/README.md
SERVER_ADDR="your_server_ip"
SERVER_PORT="your_server_port"
PASSWORD="your_password"
METHOD="aes-256-cfb"
TIMEOUT=300
@crazygit
crazygit / setup_docker.sh
Last active Dec 14, 2018
Install docker and docker-compose on ubuntu
View setup_docker.sh
#!/usr/bin/env bash
# please run as root user
# install docker
apt-get remove docker docker-engine docker.io
apt-get update
apt-get install \
apt-transport-https \
ca-certificates \
@crazygit
crazygit / run_ss_server.sh
Last active Dec 14, 2018
run shadowsocks-libev server with docker
View run_ss_server.sh
#!/usr/bin/env bash
# 配置参考:
# https://github.com/shadowsocks/shadowsocks-libev/blob/master/docker/alpine/README.md
# 密码
PASSWORD="your_password"
# 绑定到主机的端口号
SERVER_PORT=8388
# 加密方式
@crazygit
crazygit / gist:2dafb2f46633eaf8aab075c712213401
Created Apr 11, 2018 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:2dafb2f46633eaf8aab075c712213401

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
You can’t perform that action at this time.