Skip to content

Instantly share code, notes, and snippets.

samgooi4189

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
View step_dual_boot_osx_windows
1. install osx
2. install win 10
3. You will find that windows boot manager will make clover dissapear from bios
4. in Windows terminal, run as admin, Bcdedit /set {bootmgr} path \EFI\BOOT\BOOTX64.efi
5. You now able to boot to clover
@samgooi4189
samgooi4189 / cytron_esp32_install.txt
Created Oct 8, 2019
Cytron espruino ESP32 installtion
View cytron_esp32_install.txt
1. pip install esptool
2. Download all three files from http://www.espruino.com/Download, which includes bootloader.bin, espruino_esp32.bin, partitions_espruino.bin
3.
esptool.py \
--chip esp32 \
--port /dev/ttyUSB0 \
--baud 115200 \
--after hard_reset write_flash \
-z \
--flash_mode dio \
@samgooi4189
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
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]
Version=1.0
Name=Android Studio
Type=Application
Icon=/PATH/TO/ICON/studio.png
Exec=/PATH/TO/studio.sh
Change /PATH/TO/ICON/studio.png and /PATH/TO/studio.sh accordingly.
save the file as: android-studio.desktop in /usr/share/applications
View find_out_duplicates_mp4.py
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
samgooi4189 / convert_file_to_mp4.py
Created Jul 28, 2019
Convert files to mp4 with ffmpeg
View convert_file_to_mp4.py
import glob
import re
import os
EXTENSION = "flv"
for filename in glob.iglob("*.%s" % EXTENSION):
filename_without_extension = re.search("(.*).%s" % (EXTENSION) , filename).group(1)
if filename_without_extension:
print(filename_without_extension)
@samgooi4189
samgooi4189 / UbuntuBatteryStatus.sh
Created Nov 22, 2018
Ubuntu check battery status
View UbuntuBatteryStatus.sh
#!/bin/bash
upower -i /org/freedesktop/UPower/devices/battery_BAT0
@samgooi4189
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:
GOOGLE_APPLICATION_CREDENTIALS=‘config/keyFile.json’
@samgooi4189
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://keys.gnupg.net --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://keys.gnupg.net:80 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
@samgooi4189
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
You can’t perform that action at this time.