Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
" https://github.com/junegunn/vim-plug
call plug#begin('~/.local/share/nvim/plugged')
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'editorconfig/editorconfig-vim'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug '907th/vim-auto-save'
Plug 'w0rp/ale'
Plug 'ervandew/supertab'
Plug 'mxw/vim-jsx'
@huawww
huawww / buf.js
Last active December 20, 2016 08:30
ascii2str
//nodejs v6.4.0
console.log("Hello, World!");
var s = 's';
var charCode = s.charCodeAt(0);
console.log(charCode);
var buf = Buffer.from([charCode], 'ascii');
console.log(buf.toString());
@huawww
huawww / fetch.sh
Created December 16, 2016 08:29
get all shared objects
ldd file | grep "=> /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' /destination
eb create dev-env -p "64bit Amazon Linux 2014.09 v1.1.0 running Ruby 2.1 (Puma)" --single -i t2.micro --envvars key1=value1,key2=value2...
@huawww
huawww / ssl.config
Created December 14, 2016 11:30
enable https on single instance aws-eb
# https://keithpblog.wordpress.com/2015/04/13/scaling-down-to-single-instance-elastic-beanstalk/
# .ebextensions/ssl.config
Resources:
sslSecurityGroupIngress:
Type: AWS::EC2::SecurityGroupIngress
Properties:
GroupId: example_id
IpProtocol: tcp
ToPort: 443
   /bin       Essential command binaries
   /boot      Static files of the boot loader
   /dev       Device files
   /etc       Host-specific system configuration
   /lib       Essential shared libraries and kernel modules
   /media     Mount point for removeable media
   /mnt       Mount point for mounting a filesystem temporarily
   /opt       Add-on application software packages
   /sbin      Essential system binaries

/srv Data for services provided by this system

@huawww
huawww / browser.js
Created October 17, 2016 10:32
socket-io, socket-io-stream
// client(browser)
import io from 'socket.io-client';
import ss from 'socket.io-stream';
socket.on('connect', function(){
console.log('client:', socket.id, socket);
const options = {
headers:{
'Content-Type':'image/svg+xml',
}
@huawww
huawww / Dockerfile
Created October 13, 2016 07:56
docker file example
FROM busybox
ADD . /
CMD ["/IfcHandler"]
EXPOSE 3000
@huawww
huawww / 01_files.config
Created October 13, 2016 07:55
.ebextensions/01_files.config
files:
"/etc/nginx/conf.d/proxy.conf" :
mode: "000755"
owner: root
group: root
content: |
client_max_body_size 100M;