Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block samgooi4189

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
samgooi4189 / step_to_add_kernel_jupyter
Created Aug 23, 2019
Add custom kernel to jupyter notebook
View step_to_add_kernel_jupyter
Make jupyter notebook to use virtualenv
1. virtualenv ENVNAME
2. source ./ENVNAME/bin/activate
3. pip install ipykernel
4. python -m ipykernel install --user --name ENVNAME --display-name "Python (whatever you want to call it)"
samgooi4189 / ubuntu_desktop_app
Created Aug 22, 2019
Create desktop shortcut for program in Ubuntu
View ubuntu_desktop_app
Create a file ( Desktop File ) with this content:
[Desktop Entry]
Name=Android Studio
Change /PATH/TO/ICON/studio.png and /PATH/TO/ accordingly.
save the file as: android-studio.desktop in /usr/share/applications
import glob
import re
import os
target_directory ="./output"
source_directory = "."
target_filenames = [os.path.basename(x) for x in glob.glob("%s/*.mp4" % target_directory)]
source_filenames = [os.path.basename(x) for x in glob.glob("%s/*.mp4" % source_directory)]
samgooi4189 /
Created Jul 28, 2019
Convert files to mp4 with ffmpeg
import glob
import re
import os
for filename in glob.iglob("*.%s" % EXTENSION):
filename_without_extension ="(.*).%s" % (EXTENSION) , filename).group(1)
if filename_without_extension:
samgooi4189 /
Created Nov 22, 2018
Ubuntu check battery status
upower -i /org/freedesktop/UPower/devices/battery_BAT0
samgooi4189 / gcloudKeyToApp
Created Oct 24, 2018
Adding Google service account key to heroku or your app
View gcloudKeyToApp
set the environment variable to the path of your gcloud service account key:
samgooi4189 / rvm_fix_pgpkey
Created Oct 1, 2018
getting public key from rvm
View rvm_fix_pgpkey
On the official rvm website,
gpg --keyserver hkp:// --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
Sometimes it will fails due to firewall, so you need to add port 80 at the end of url
gpg --keyserver hkp:// --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
samgooi4189 / create_virtualenv_kernel_for_jupyter
Created Sep 28, 2018
Create virtualenv kernel for jupyter notebook
View create_virtualenv_kernel_for_jupyter
python -m ipykernel install --user --name virtenv --display-name "Python (virtuenv)"
virtenv is the virtualenv name that you set for your project
# Usage: python3
import glob
import os
for filename in glob.iglob('*.ts'):
print('\nConverting %s to mp4..........................' % filename)
name = filename.split(".ts")[0]
os.system("ffmpeg -i %s -acodec copy -vcodec copy %s.mp4 " % (filename,name))
samgooi4189 /
Last active Jul 24, 2018 — forked from cortesben/
Mercurial command cheat sheet

Mercurial Commands

Commands Description
hg pull get latest changes like git pull use flags like -u IDK why yet
hg add only for new files
hg commit add changes to commit with -m for message just like git
hg addremove adds new files and removes file not in your file system
hg incoming see changes commited by others
hg outgoing see local commits
You can’t perform that action at this time.