Skip to content

Instantly share code, notes, and snippets.

View SebastienElet's full-sized avatar
🏠
Working from home

Sébastien ELET SebastienElet

🏠
Working from home
View GitHub Profile
@SebastienElet
SebastienElet / libxl.rb
Last active October 12, 2015 12:07
Homebrew php54-excel (using libxl)
require 'formula'
class Libxl < Formula
homepage 'http://www.libxl.com/'
url 'ftp://xlware.com/libxl-mac-3.6.0.tar.gz'
sha1 '52da78f73e4a8e727c8c73c99435f4136e3774c2'
def install
lib.install 'lib/libxl.dylib'
include.install Dir["include_c/*.h"]
@SebastienElet
SebastienElet / .vimrc
Created December 11, 2012 17:00
.vimrc
set encoding=utf-8
set number
set title
syntax on
set autoindent
set expandtab
set background=dark
@SebastienElet
SebastienElet / install.sh
Created July 9, 2013 15:39
Node installer
#!/bin/sh
apt-get install -y curl
CURRENT=$(node -v)
VERSION=$(curl -L -s http://nodejs.org/dist/latest/ \
| egrep -o '[0-9]+\.[0-9]+\.[0-9]+' \
| tail -n1)
PLATFORM=linux
ARCH=x64
PREFIX="/usr/local/"
@SebastienElet
SebastienElet / tdb.patch
Created August 1, 2013 12:46
Tdb patch file
--- tdbtool.c 2008-01-20 22:26:37.000000000 +0100
+++ tdbtool.c 2008-01-20 22:27:45.000000000 +0100
@@ -169,23 +169,21 @@
static void help(void)
{
- printf("
-tdbtool:
- create dbname : create a database
- open dbname : open an existing database
@SebastienElet
SebastienElet / redis-backup.sh
Last active August 29, 2015 14:02
redis-backup.sh
#!/bin/bash
BACKUP=/home/backups/redis
REDIS_SOURCE=/var/lib/redis/dump.rdb
REDIS_DEST=$BACKUP/$(date +"%Y-%m-%d")-dump.rdb
find $BACKUP/* -name "*.rdb" -mtime +7 -exec rm {} \;
redis-cli save > /dev/null
cp $REDIS_SOURCE $REDIS_DEST
@SebastienElet
SebastienElet / mysql
Created July 30, 2014 09:10
Mysql 5.6 connect
#!/usr/bin/expect
spawn mysql -u root -p
expect "assword:"
send "<pass>\r"
interact
@SebastienElet
SebastienElet / MacOs-key.sh
Last active August 28, 2020 14:49
Catalina usb key
# Catalina
sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia \ ~/Code
--volume /Volumes/Install\ macOS\ Mojave \
--nointeraction
# Mojave
sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia \ ~/Code
--volume /Volumes/Install\ macOS\ Sierra \
--nointeraction
# cpu
time echo "scale=5000; a(1)*4" | bc -l
# disk
time sh -c "dd if=/dev/zero of=/tmp/test.tmp bs=4k count=200000 && sync"
# io
mysqlslap --user=root --password --concurrency=50 --iterations=10 --number-int-cols=5 --number-char-cols=20 --auto-generate-sql --verbose
# à tester
@SebastienElet
SebastienElet / tasks.yml
Created December 8, 2015 11:48
ansible install ssh keys
- name: install ssh keys
copy:
content: "{{ item.value }}"
dest: /home/www/.ssh/{{ item.key }}
mode: 0600
owner: www
with_dict: github_ssh_keys
no_log: True
- name: install ssh key
@SebastienElet
SebastienElet / es5-to-es6.sh
Created August 12, 2016 10:06
es5-to-es6.sh
CODEMOD_PATH="/tmp/js-codemod"
npm i -g eslint jscodeshift
git clone https://github.com/cpojer/js-codemod.git
# Run eslint fix
npm run cli eslint --fix "$1"
# Run es6 codemod
for codemod in no-vars template-literals object-shorthand unchain-variables unquote-properties updated-computed-props;