Skip to content

Instantly share code, notes, and snippets.

View henrytseng's full-sized avatar

Henry Tseng henrytseng

View GitHub Profile
@henrytseng
henrytseng / .tmux.conf
Last active September 27, 2019 14:19
.tmux.conf
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
#set -g default-terminal "screen-256color"
#set -ga terminal-overrides ",screen-256color:Tc"
# statusbar
# set -g status-style 'bg=colour235 fg=colour136'
@rjhansen
rjhansen / keyservers.md
Last active April 14, 2024 12:28
SKS Keyserver Network Under Attack

SKS Keyserver Network Under Attack

This work is released under a Creative Commons Attribution-NoDerivatives 4.0 International License.

Terminological Note

"OpenPGP" refers to the OpenPGP protocol, in much the same way that HTML refers to the protocol that specifies how to write a web page. "GnuPG", "SequoiaPGP", "OpenPGP.js", and others are implementations of the OpenPGP protocol in the same way that Mozilla Firefox, Google Chromium, and Microsoft Edge refer to software packages that process HTML data.

Who am I?

@henrytseng
henrytseng / install_bundles
Last active October 23, 2023 02:11
Install vim bundles with pathogen
#!/bin/bash
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
mkdir -p ~/.vim/autoload ~/.vim/bundle
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
cd ~/.vim/bundle
git clone https://github.com/kien/ctrlp.vim
git clone https://github.com/vim-airline/vim-airline
# Aliases
#alias ls='ls -aF -G' # List files with symbols (/ * @) and colors
alias viprofile="vi ~/.bash_profile && source ~/.bash_profile"
alias vialias="vi ~/.bash_aliases && source ~/.bash_aliases"
alias less='less -r'
alias l='ls'
alias ll='ls -alF -G' # List files including hidden files, with symbols
alias diff='grc diff'
# K8s
@henrytseng
henrytseng / .vimrc
Last active June 13, 2019 01:47
Vim configuration
set nocompatible " be iMproved, required
filetype plugin indent on
" Change indentation
set expandtab
set shiftwidth=2
set softtabstop=2
set modelines=0
set nomodeline
@henrytseng
henrytseng / .bash_profile
Last active September 27, 2019 14:19
Bash profile git branch
source $HOME/.bash_aliases
source $HOME/.ssh/iterm2-color.sh
# colors
PS1='\w\[\033[0;32m\]$( git branch 2> /dev/null | cut -f2 -d\* -s | sed "s/^ / [/" | sed "s/$/]/" )\[\033[0m\] \$ '
# Tell grep to highlight matches
export GREP_OPTIONS='--color=auto'
# Tell ls to be colourful
@magnetikonline
magnetikonline / README.md
Last active June 22, 2024 06:03
List all Git repository objects by size.

List all Git repository objects by size

Summary

Bash script which will:

  • Iterate all commits made within a Git repository.
@GregBaugues
GregBaugues / token.rb
Last active July 11, 2022 02:21
Google API OAuth 2.0 refresh token (Ruby on Rails)
# The OAuth access token provided by the Google API expires in 60 minutes. After expiration,
# you must exchange a refresh token for a new access token. Unfortunately, the the Google API
# ruby gem does not include a method for refreshing access tokens.
# You can read up on how to refresh an access token here:
# https://developers.google.com/accounts/docs/OAuth2WebServer#refresh
# This Token model implements that process. It's based off of a Token model that can be created
# by running:
# rails g model Token token:text refresh_token:string expires_at:datetime
@gregersrygg
gregersrygg / README.md
Last active July 28, 2020 17:01
Use a Raspberry Pi as a baby monitor

What you need:

  • Raspberry Pi RevB
  • Raspberry Pi NoIR camera

Download raspbian and install to SD-card. Here is a good guide on how to install the .img file to the card: https://www.andrewmunsell.com/blog/getting-started-raspberry-pi-install-raspbian

Connect ethernet or wifi, then boot the Raspberry Pi and follow configuration options. Make sure you enable the camera option.

When you get to the command-line:

@chrisle
chrisle / gist:2252209
Created March 30, 2012 15:15
CURL as GoogleBot 2.1
curl --user-agent "Googlebot/2.1 (+http://www.google.com/bot.html)" -v $@