Skip to content

Instantly share code, notes, and snippets.

@ysheng26
ysheng26 / keys.go
Created January 23, 2020 19:04 — forked from sdorra/keys.go
Golang RSA Key Generation
/*
* Genarate rsa keys.
*/
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
@ysheng26
ysheng26 / ffmpeg-compress-mp4
Created July 25, 2019 14:27 — forked from lukehedger/ffmpeg-compress-mp4
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
@ysheng26
ysheng26 / foo.log
Created October 17, 2018 01:21 — forked from ibeex/foo.log
Flask logging example
A warning occurred (42 apples)
An error occurred
@ysheng26
ysheng26 / keyrepeat.shell
Created April 24, 2018 15:31 — forked from kconragan/keyrepeat.shell
Enable key repeat in Apple Lion for Sublime Text in Vim mode
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
@ysheng26
ysheng26 / gist:bc0e0cdf740e2934bc467dfdc081b8e7
Last active July 19, 2016 01:11
Microsoft Natural Ergonomic 4000 for Ubuntu
On Xubuntu 13.10 (perhaps on Ubuntu 13.10 too) the same can be done as follows:
Edit key mappings in /lib/udev/hwdb.d/60-keyboard.hwdb:
###########################################################
# Microsoft
###########################################################
# Microsoft Natural Ergonomic Keyboard 4000
keyboard:usb:v045Ep00DB*
@ysheng26
ysheng26 / multiple_ssh_setting.md
Created June 30, 2016 19:59 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@ysheng26
ysheng26 / solarized.bash
Created June 11, 2016 03:15 — forked from kraft001/solarized.bash
solarized Gnome Terminal + Tmux + Vim
# store all solarized files in one place
mkdir ~/.solarized
cd ~/.solarized
# http://www.webupd8.org/2011/04/solarized-must-have-color-paletter-for.html
git clone https://github.com/seebi/dircolors-solarized.git
eval `dircolors ~/.solarized/dircolors-solarized/dircolors.256dark`
ln -s ~/.solarized/dircolors-solarized/dircolors.256dark ~/.dir_colors
git clone https://github.com/sigurdga/gnome-terminal-colors-solarized.git
@ysheng26
ysheng26 / interviewitems.MD
Created January 27, 2016 02:43 — forked from KWMalik/interviewitems.MD
My answers to over 100 Google interview questions

##Google Interview Questions: Product Marketing Manager

  • Why do you want to join Google? -- Because I want to create tools for others to learn, for free. I didn't have a lot of money when growing up so I didn't get access to the same books, computers and resources that others had which caused money, I want to help ensure that others can learn on the same playing field regardless of their families wealth status or location.
  • What do you know about Google’s product and technology? -- A lot actually, I am a beta tester for numerous products, I use most of the Google tools such as: Search, Gmaill, Drive, Reader, Calendar, G+, YouTube, Web Master Tools, Keyword tools, Analytics etc.
  • If you are Product Manager for Google’s Adwords, how do you plan to market this?
  • What would you say during an AdWords or AdSense product seminar?
  • Who are Google’s competitors, and how does Google compete with them? -- Google competes on numerous fields: --- Search: Baidu, Bing, Duck Duck Go
@ysheng26
ysheng26 / uNoWatermark.py
Last active September 10, 2015 22:29
Removes the annoying watermarks of it-ebooks.info's downloaded eBooks
import re
import shutil
import argparse
from os import path
from sys import stderr
#
# Author: Daxda
# Date: 02.04.2014
# WTF: This is a quick tool I've hacked together to easily remove the meta