Skip to content

Instantly share code, notes, and snippets.

View s5unty's full-sized avatar

Sun Wuan s5unty

View GitHub Profile
#!/bin/bash
#
#this script contributed by Matthias Meyer
#note that if your $Topdir seems to be wrong (because it is empty), the script will ask you
#the new location.
#
#10/2009 JJK: Modified by Jeffrey J. Kosowsky
# add --nightly
# check if user eguals root or backuppc
#11/2009 MMT: Modified by Matthias Meyer
@rhuss
rhuss / execute_groovy_jenkins_sample.groovy
Last active August 12, 2020 19:09
How to execute some shell scripting on Groovy with environment variables and redirection
def exec(cmd) {
println cmd
def process = new ProcessBuilder([ "sh", "-c", cmd])
.directory(new File("/tmp"))
.redirectErrorStream(true)
.start()
process.outputStream.close()
process.inputStream.eachLine {println it}
process.waitFor();
return process.exitValue()
@nickcarenza
nickcarenza / mycnf.go
Created January 30, 2017 22:31
Golang read connection details from my.cnf
package db
// stdlib
import (
"fmt"
"os"
)
// external
import (
@dlants
dlants / denite.md
Last active March 5, 2021 06:13
denite setup with interactive ag pattern-search of project contents

Files

First things first, I want to use ag to search through my project files. Coming from fzf, I like to have two bindings for this -- one that respects my projects .gitignore and one that does not. The latter is helpful if I want to examine a built file or look at a node_module dependency while working on my js project.

I use an alias for file_rec source to toggle the -u flag on ag. Now, <C-P> searches in my git files, and <C-O> searches everything.

" denite file search (c-p uses gitignore, c-o looks at everything)
map <C-P> :DeniteProjectDir -buffer-name=git -direction=top file_rec/git<CR>
map  :DeniteProjectDir -buffer-name=files -direction=top file_rec
@napramirez
napramirez / ConvertLetsPemToPfx.sh
Created December 18, 2017 04:43
Convert LetsEncrypt Certificates to PFX
#!/bin/sh
#
# Copy of https://gist.githubusercontent.com/arichika/b1a1413b554734ae964f/raw/e657ad2dc4ddab60750d26e87add61f9b988d887/ConvertLetsPemToPfx.sh
#
pemsdir='/etc/letsencrypt/archive' # default search PEMs
pfxspath='/share/letsencrypt/archive' # dest of the PFXs
passfile='/share/letsencrypt/pass.txt' # password to be applied to the PFX file
for cnvifull in `find "${pemsdir}" -name 'cert*.pem' -o -name '*chain*.pem'`
@fwenzel
fwenzel / cleanup-maildir.py
Created January 19, 2010 12:13
A script for cleaning up mails in Maildir folders
#!/usr/bin/python -tt
"""
USAGE
cleanup-maildir [OPTION].. COMMAND FOLDERNAME..
DESCRIPTION
Cleans up old messages in FOLDERNAME; the exact action taken
depends on COMMAND. (See next section.)
Note that FOLDERNAME is a name such as 'Drafts', and the
# cat /proc/cpuinfo | grep "^processor" | wc -l
16
# cat /proc/cpuinfo | grep "^model name" | head -1
model name : Intel(R) Xeon(R) CPU E5520 @ 2.27GHz
# openssl speed md5
Doing md5 for 3s on 16 size blocks: 3787525 md5's in 3.00s
Doing md5 for 3s on 64 size blocks: 3016201 md5's in 3.00s
Doing md5 for 3s on 256 size blocks: 1856180 md5's in 3.00s
@josevalim
josevalim / phoenix showdown rackspace onmetal io.md
Last active October 31, 2022 13:59 — forked from omnibs/phoenix showdown rackspace onmetal io.md
Phoenix Showdown Comparative Benchmarks @ Rackspace

Comparative Benchmark Numbers @ Rackspace

I've taken the benchmarks from Matthew Rothenberg's phoenix-showdown, updated Phoenix to 0.13.1 and ran the tests on the most powerful machines available at Rackspace.

Results

Framework Throughput (req/s) Latency (ms) Consistency (σ ms)
@lyuboraykov
lyuboraykov / piping.groovy
Created August 8, 2014 11:19
Execute shell command with piping in groovy
def command = 'ls | grep foo'
def output = ['bash', '-c', command].execute().in.text
@xkou
xkou / gist:8572872
Created January 23, 2014 04:33
install tengine with luagit
# git clone https://github.com/simpl/ngx_devel_kit.git
cd tengine-2.0.0/
# tell nginx's build system where to find LuaJIT 2.0:
export LUAJIT_LIB=/usr/local/lib
export LUAJIT_INC=/usr/local/include/luajit-2.0/
# Here we assume Nginx is to be installed under /opt/nginx/.