Skip to content

Instantly share code, notes, and snippets.

@scupython
scupython / .emacs.d_init.el
Created March 8, 2018 01:03
emacs configuration
(require 'package)
(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")))
(package-initialize)
;; set theme
(setq inhibit-startup-message t)
;(when (fboundp 'menu-bar-mode) (menu-bar-mode -1))
328 ffmpeg -y -ss 1 -t 7 -i xxx.webm -vf fps=10,scale=480:-1:flags=lanczos,palettegen patette.png
329 ffmpeg -ss 1 -t 7 -i xxx.webm -i patette.png -filter_complex "fps=10,scale=480:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif
@scupython
scupython / refind.conf
Last active February 27, 2018 04:49
kernel params
"Boot with standard options" "root=UUID=<your uuid of root partition> rw quiet acpi_rev_override=1 initrd=/boot/initramfs-linux.img initrd=/boot/intel-ucode.img enable_psr=1 disable_power_well=0 nvme_core.default_ps_max_latency_us=130000"
"Boot to single-user mode" "root=UUID=<your uuid of root partition> rw quiet acpi_rev_override=1 single"
"Boot with minimal options" "ro root=/dev/<your root partition name>"
@scupython
scupython / wpa_applicant.conf
Created February 27, 2018 03:50
wpa_applicant conf when connect to hidden ssid
update_config=1
ap_scan=2
ctrl_interface=/var/run/wpa_supplicant
network={
mode=0
scan_ssid=1
proto=WPA2
key_mgmt=WPA-PSK
pairwise=CCMP
yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel
yum groupinstall "Development tools"
cd /tmp
wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tar.xz
tar xf Python-3.5.1.tar.xz
cd Python-3.5.1
./configure && make && make install
@scupython
scupython / ssl_smtp_example.go
Created November 19, 2015 05:45 — forked from chrisgillis/ssl_smtp_example.go
Golang SSL SMTP Example
package main
import (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)
@scupython
scupython / install-odoo.sh
Last active September 21, 2015 09:33 — forked from yelizariev/install-odoo.sh
install odoo from source
if [ "$(basename $0)" = "install-odoo.sh" ]; then
echo "don't run install-odoo.sh, because it's not fully automated script. Copy, paste and execute commands from this file manually"
exit 0
fi
#### Detect type of system manager
export SYSTEM=''
pidof systemd && export SYSTEM='systemd'
@scupython
scupython / preprocessor_fun.h
Last active August 29, 2015 14:28 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
def index_to_int(index):
s = 0
pow = 1
for letter in index[::-1]:
d = int(letter,36) - 9
s += pow * d
pow *= 26
# excel starts column numeration from 1
return s
# -*- Encoding: utf-8 -*-
import base64
import binascii
import cgi
import hashlib
import hmac
import logging
import time
import urllib
import urlparse