Skip to content

Instantly share code, notes, and snippets.

View tuxlinuxien's full-sized avatar

Yoann Cerda tuxlinuxien

View GitHub Profile
@tuxlinuxien
tuxlinuxien / oauth2_integration.go
Last active October 18, 2023 10:50
gin gonic oauth2 integration
package main
import (
"bytes"
"encoding/json"
"github.com/gin-gonic/gin"
"golang.org/x/oauth2"
"golang.org/x/oauth2/bitbucket"
"golang.org/x/oauth2/github"
"golang.org/x/oauth2/google"
@tuxlinuxien
tuxlinuxien / main.go
Created May 19, 2016 11:24
simple golang htt2 server ( go >= 1.6)
package main
/*
** generate certifictes:
** $> openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout key.pem -out cert.pem
** [...]
** Country Name (2 letter code) [AU]:CN
** State or Province Name (full name) [Some-State]:
** Locality Name (eg, city) []:
** Organization Name (eg, company) [Internet Widgits Pty Ltd]:
@tuxlinuxien
tuxlinuxien / crontab
Last active December 2, 2016 03:52
nginx_conf http/2
30 2 * * 1 /usr/bin/letsencrypt renew >> /var/log/le-renew.log
@tuxlinuxien
tuxlinuxien / .zshrc
Created May 31, 2016 04:27
root .zshrc
#!/bin/zsh
# completion
autoload -U compinit
compinit
zstyle ':completion:*' menu select
setopt MENU_COMPLETE
# correction
@tuxlinuxien
tuxlinuxien / install-shadowsocks-ubuntu.sh
Last active October 25, 2023 02:08
Shadowsocks installer for ubuntu 16.04
#!/bin/sh
cd $HOME;
echo "Running apt-get update ..."
sudo apt-get update > /dev/null
echo "Install installing dependencies ..."
sudo apt-get install -y --no-install-recommends gettext build-essential autoconf libtool libpcre3-dev asciidoc xmlto libev-dev libc-ares-dev automake libmbedtls-dev libsodium-dev > /dev/null
if [ -d "shadowsocks-libev" ]; then
echo -n;
@tuxlinuxien
tuxlinuxien / gulpfile.js
Created August 25, 2017 03:20
gulpfile style
// include the required packages.
var gulp = require('gulp');
var stylus = require('gulp-stylus');
var koutoSwiss = require( "kouto-swiss" );
// Options
// Options compress
gulp.task('styles', function () {
return gulp.src('./css/main.styl')
.pipe(stylus({
@tuxlinuxien
tuxlinuxien / setup.sh
Created April 10, 2018 04:04
compile nginx configure flags
./configure \
--prefix=/usr/share/nginx \
--conf-path=/etc/nginx/nginx.conf \
--http-log-path=/var/log/nginx/access.log \
--error-log-path=/var/log/nginx/error.log \
--lock-path=/var/lock/nginx.lock \
--pid-path=/run/nginx.pid \
--modules-path=/usr/lib/nginx/modules \
--http-client-body-temp-path=/var/lib/nginx/body \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
#!/usr/bin/env bash
rm -rf file*.bin
rm -rf test_tar.tar test_my_tar.tar mytest6 test6
dd if=/dev/zero of=./file1.bin bs=1048570 count=1 2> /dev/null >> /dev/null
dd if=/dev/zero of=./file2.bin bs=1048570 count=2 2> /dev/null >> /dev/null
dd if=/dev/zero of=./file3.bin bs=1048570 count=3 2> /dev/null >> /dev/null
dd if=/dev/zero of=./file4.bin bs=1048570 count=4 2> /dev/null >> /dev/null
dd if=/dev/zero of=./file5.bin bs=1048570 count=5 2> /dev/null >> /dev/null
@tuxlinuxien
tuxlinuxien / test3.sh
Created June 27, 2018 14:20
test3.sh
#!/usr/bin/env bash
rm -rf bigfile.bin
for i in {1..20}; do
echo "++ test $i download... ++"
rm -rf dowloaded_bigfile.bin
dd if=/dev/urandom of=./bigfile.bin bs=1048570 count=100 2> /dev/null >> /dev/null
curl -o dowloaded_bigfile.bin http://localhost:8000/bigfile.bin 2> /dev/null > /dev/null
md5sum bigfile.bin dowloaded_bigfile.bin