This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
sudo apt-get install ubuntu-restricted-extras | |
# | |
sudo apt-get install libavformat-extra-53 libavcodec-extra-53 | |
# install Oracle 7 Java | |
sudo add-apt-repository ppa:webupd8team/java | |
sudo apt-get update | |
sudo apt-get install oracle-java7-installer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#generate | |
ssh-keygen -t rsa | |
#push to server | |
ssh user@xx.xxx.xx.xx mkdir -p .ssh | |
cat ~/.ssh/id_rsa.pub | ssh user@123.45.56.78 "cat >> ~/.ssh/authorized_keys" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
#post-receive | |
import sys | |
import subprocess | |
# 1. Read STDIN (Format: "from_commit to_commit branch_name") | |
(old, new, branch) = sys.stdin.read().split() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- drop all object in the schema | |
drop schema public cascade; | |
create schema public; | |
-- change owner of the schema and all objects | |
REASSIGN OWNED BY old_role [, ...] TO new_role |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################## | |
## RangeSlider | |
# | |
ko.bindingHandlers.rangeSlider = | |
init: (element, valueAccessor, allBindingsAccessor) -> | |
options = valueAccessor() || {} | |
params = allBindingsAccessor() || {} | |
console.log options | |
console.log params |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ko.bindingHandlers.valueInit = | |
init: (element, valueAccessor) -> | |
property = valueAccessor() | |
if !ko.isWriteableObservable(property) | |
throw new Error 'Knockout "valueInit" binding expects an observable.' | |
property element.value | |
#html example | |
#<input data-bind="value: message, valueInit: 'Hello world'" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################## | |
## jQuery UI Datepicker bindings | |
# | |
ko.bindingHandlers.datepicker = | |
init: (element, valueAccessor, allBindingsAccessor) -> | |
options = allBindingsAccessor().datepickerOptions || {} | |
$(element).datepicker options | |
#/handle the field changing | |
ko.utils.registerEventHandler element, "change", () -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#znapi.conf | |
description "node.js zn api" | |
env FULL_PATH="/home/zn/app.prod" | |
env NODE_PATH="/usr/bin/node" | |
env LOG="/var/log/znapi.log" | |
env PIDFILE="/var/run/znapi.pid" | |
# Start up when the system hits any normal runlevel, and | |
start on filesystem or runlevel [2345] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dependencies to make "headless" chrome/selenium work: | |
sudo apt-get -y install xvfb gtk2-engines-pixbuf | |
sudo apt-get -y install xfonts-cyrillic xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable | |
echo "Starting X virtual framebuffer (Xvfb) in background..." | |
Xvfb -ac :99 -screen 0 1280x1024x16 & | |
export DISPLAY=:99 |
OlderNewer