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 / .gitignore
Last active March 24, 2021 17:00
Pino serializer issue with prisma
node_modules
@SebastienElet
SebastienElet / Dockerfile
Last active September 25, 2018 08:04
Libxl build on node 8.9.3
FROM node:8.9.3 as tools
COPY package.json ./
RUN npm install --non-interactive --production=false

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
sudo mkdir -pv /build/toolchain/mac32/openssl-1.0.1p/lib/
cd /build/toolchain/mac32/openssl-1.0.1p/lib/
sudo ln -s /Applications/VMware\ Client\ Integration\ Plug-in.app/Contents/Library/lib/libssl.1.0.1.dylib
sudo ln -s /Applications/VMware\ Client\ Integration\ Plug-in.app/Contents/Library/lib/libcrypto.1.0.1.dylib
sudo /Applications/VMware\ Client\ Integration\ Plug-in.app/Contents/Library/vmware-csd-installer --install
@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;
@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
# 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 / 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
@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 / 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