Skip to content

Instantly share code, notes, and snippets.

View chebykin's full-sized avatar

Nikita Chebykin chebykin

View GitHub Profile
var apiRelationalCollection = {
method: false,
type: false,
loading: function (data) {
return data;
},
data: false,
relational: false
};
@chebykin
chebykin / new_rails_app_cheat_sheet
Created July 29, 2014 07:58
Install Rails on Ubuntu cheat-sheet
Install Rails on Ubuntu cheat-sheet:
1. install plain ubuntu 14.04
2. if you installing virtual machine like vmware, first thing todo:
sudo apt-get install openssh-server
3. install next packages:
sudo apt-get install git vim g++ make libssh-dev curl libsqlite3-dev
4. install ruby version manager rvm:
curl https://raw.githubusercontent.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash
5. install latest ruby version (versions list is available through ```rbenv install -l```). for ex
@chebykin
chebykin / vscale_api.sh
Last active October 31, 2016 14:19
vscale.io api requests templates
export VSCALE_TOKEN=your_vscale_token
# fetch available configurations
curl 'https://api.vscale.io/v1/rplans' -H 'X-Token: '$VSCALE_TOKEN | python -m json.tool
# create vscale instance, vscale binary file shuold be available in your $PATH
docker-machine create -d vscale --vscale-access-token $VSCALE_TOKEN --vscale-location=msk0 --vscale-rplan small --vscale-made-from ubuntu_16.04_64_001_master machine_name
@chebykin
chebykin / gist:19c936d1301e6dfefa58853156e64cd8
Last active November 29, 2016 14:28
js closure inside loop
for(var i = 0; i < 10; i++) {
setTimeout(function() {
console.log(i);
}, 10);
}
@chebykin
chebykin / liquidsoap-dependencies.sh
Created February 16, 2017 21:51
Install liquidsoap dependencies on Debain (not complete list)
apt-get install libmp3lame-ocaml-dev libshine-ocaml-dev libaac-tactics-ocaml-dev libogg-ocaml-dev libvorbis-ocaml-dev libspeex-ocaml-dev libtheora-ocaml-dev libopus-ocaml-dev libschroedinger-ocaml-dev libvoaacenc-ocaml-dev libfdkaac-ocaml-dev libfaad-ocaml-dev libflac-ocaml-dev libladspa-ocaml-dev libsoundtouch-ocaml-dev libsoundtouch-ocaml-dev libsamplerate-ocaml-dev libdssi-ocaml-dev libxmlplaylist-ocaml-dev liblastfm-ocaml-dev liblo-ocaml-dev libdtools-ocaml-dev libduppy-ocaml-dev libmm-ocaml-dev
@chebykin
chebykin / kurento-snippets.sh
Last active February 20, 2017 11:45
Kurento snippets
# to install .so files into /usr directory use the following flag:
cmake . -DCMAKE_INSTALL_PREFIX=/usr
# build .deb file if possible
debuild -uc -us
@chebykin
chebykin / GStreamer-1.0 some strings.sh
Created March 8, 2017 12:03 — forked from strezh/GStreamer-1.0 some strings.sh
GStreamer-1.0 personal cheat sheet
#!/bin/bash
# play YUV444 FULL HD file
gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \
videoparse width=1920 height=1080 framerate=25/1 format=GST_VIDEO_FORMAT_Y444 ! \
videoconvert ! \
autovideosink
# play YUV422 FULL HD file
gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \
AUDIO_CAPS="application/x-rtp,media=(string)audio,clock-rate=(int)48000,encoding-name=(string)X-GST-OPUS-DRAFT-SPITTKA-00"
# listen
gst-launch-1.0 udpsrc caps=$AUDIO_CAPS port=33258 ! \
rtpopusdepay ! opusdec plc=true ! autoaudiosink
# stream
gst-launch-1.0 -vvvvv audiotestsrc ! audioconvert ! opusenc ! rtpopuspay ! udpsink port=33258 host=<your IP>
@chebykin
chebykin / stream.sh
Created March 12, 2017 13:46
Gstreamer stream h264 to UDP port
# sudo apt-get install openh264-gst-plugins-bad-1.5
gst-launch-1.0 videotestsrc ! x264enc ! rtph264pay ! udpsink host=127.0.0.1 port=9754
sdp <<< EOF
v=0
m=video 5000 RTP/AVP 96
c=IN IP4 127.0.0.1
a=rtpmap:96 H264/90000
EOF
@chebykin
chebykin / eth.sh
Created July 4, 2017 12:18
Ethereum CLI snippets
# Run Geth with dev network and enable APIs required by truffle
geth --dev --rpcapi eth,net,web3,personal --rpc