Skip to content

Instantly share code, notes, and snippets.

View mofelee's full-sized avatar
🎯
Focusing

mofelee

🎯
Focusing
View GitHub Profile
@mofelee
mofelee / OpenSSL Cheatsheet.md
Created October 25, 2016 03:43 — forked from davewongillies/OpenSSL Cheatsheet.md
OpenSSL Cheatsheet

General OpenSSL Commands

These commands allow you to generate CSRs, Certificates, Private Keys and do other miscellaneous tasks.

  • Generate a new private key and Certificate Signing Request
openssl req -out CSR.csr -new -newkey rsa:2048 -nodes -keyout privateKey.key
  • Generate a self-signed certificate (see How to Create and Install an Apache Self Signed Certificate for more info)
@mofelee
mofelee / package.json
Created November 9, 2016 07:36 — forked from addyosmani/package.json
npm run-scripts boilerplate
{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",

Linux - Systemd cheatsheet

systemctl

Activates a service immediately:

systemctl start foo.service

Deactivates a service immediately:

@mofelee
mofelee / bash-cheatsheet.sh
Created February 21, 2017 07:40 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@mofelee
mofelee / varnish
Created February 21, 2017 07:48 — forked from reifman/varnish
Example Varnish configuration file e.g. /etc/default/varnish
# Configuration file for varnish
#
# /etc/init.d/varnish expects the variables $DAEMON_OPTS, $NFILES and $MEMLOCK
# to be set from this shell script fragment.
#
# Should we start varnishd at boot? Set to "no" to disable.
START=yes
# Maximum number of open files (for ulimit -n)

via (https://www.linux.com/learn/tutorials/442438-vim-tips-folding-fun)

  • zf#j creates a fold from the cursor down # lines.
  • zf/string creates a fold from the cursor to string .
  • zj moves the cursor to the next fold.
  • zk moves the cursor to the previous fold.
  • zo opens a fold at the cursor.
  • zO opens all folds at the cursor.
  • zm increases the foldlevel by one.
  • zM closes all open folds.
@mofelee
mofelee / vim_cheatsheet.txt
Created May 16, 2017 08:28 — forked from fernandes/vim_cheatsheet.txt
my vim cheatsheet.txt
## Vim
### Basic
enable line numbers :set number | :set nu
disable line numbers :set nonumber | :set nonu | :set nu!
enable relative numbers :set relativenumber
convert entire word to uppercace <leader>u
convert entire word to lowercase <leader>l
convert first char of word to uppercase <leader>U
convert first char of word to lowercase <leader>L
@mofelee
mofelee / reference.lua
Created June 4, 2017 17:20 — forked from doches/reference.lua
Lua Cheat Sheet
-- Lua Cheat Sheet for Programmers, by Al Sweigart http://coffeeghost.net
-- This cheat sheet is an executable Lua program.
--[[ This is
a multline comment]]
---[[ This is a neat trick. The first -- makes -[[ not a multiline comment.
print("This line executes.")
--]] The rest of this line is also a comment.
print("Here is a string" .. ' concatenated with ' .. 2 .. ' other strings.')
@mofelee
mofelee / enable_bbr.sh
Created September 25, 2017 10:45
Update linux kernel and enable google bbr on ubuntu
#!/bin/sh
# update kernel
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10-rc1/linux-image-4.10.0-041000rc1-generic_4.10.0-041000rc1.201612252031_amd64.deb
dpkg -i linux-image-4.10.0*.deb
update-grub
reboot
# check kernel
uname -a
@mofelee
mofelee / k8s-create-deployment.go
Created November 9, 2017 06:31 — forked from ffledgling/k8s-create-deployment.go
kubernetes client-go example: Create a Deployment based on json
package main
import (
"encoding/json"
"log"
"os"
// We use pretty instead of the common go-spew or pretty-printing because,
// go-spew is vendored in client-go and causes problems
"github.com/kr/pretty"