Skip to content

Instantly share code, notes, and snippets.

View donnykurnia's full-sized avatar

Donny Kurnia donnykurnia

View GitHub Profile
@MrHallows
MrHallows / fastboot_help.md
Last active April 23, 2024 04:02
fastboot commands

Command:

$ fastboot help

Output:

usage: fastboot [OPTION...] COMMAND...

flashing:
@FinnWoelm
FinnWoelm / read-text-message.sh
Created December 27, 2019 14:01
How to read text messages from USB modem
# Full instructions: http://manpages.ubuntu.com/manpages/bionic/en/man8/mmcli.8.html
# Examples: http://manpages.ubuntu.com/manpages/bionic/en/man8/mmcli.8.html#examples
# Supported modems: https://www.freedesktop.org/wiki/Software/ModemManager/SupportedDevices/
# Get list of connected modems.
mmcli --list-modems
# Output:
# Found 1 modems:
# /org/freedesktop/ModemManager1/Modem/1 [huawei] E3531
# The number at the end of the path is the modem index.
@juliendkim
juliendkim / add (multiple) SRT to MP4 and MOV.sh
Last active April 29, 2024 13:19
Add multiple subtitles to an MP4/MOV with FFMPEG
# single subtitle with MP4(for MOV : change mov_text to srt)
$ ffmpeg -i VIDEO.mp4 -i SUBTITLE.srt -c:v copy -c:a copy -c:s mov_text OUTPUT.mp4
$ ffmpeg -i VIDEO.mov -i SUBTITLE.srt -c:v copy -c:a copy -c:s srt OUTPUT.mov
# multiple subtitles with MP4(for MOV : change mov_text to srt)
$ ffmpeg -i VIDEO.mp4 -i KOREAN.srt -i ENGLISH.srt \
-c:v copy -c:a copy -c:s mov_text \
-map 0:v -map 0:a -map 1 -map 2 \
-metadata:s:s:0 language=kor -metadata:s:s:1 language=eng \
OUTPUT.mp4
@hachesilva
hachesilva / restart-cinnamon-in-linux-mint.txt
Created March 5, 2019 15:24
Several ways to restart Cinnamon in Linux Mint
1. Hit ctrl+alt+esc
2. Hit Alt+F2, type r, and press Enter
3. Switch to another tty, for example tty6, by pressing Ctrl+Alt+F6
Run:
pkill -HUP -f "cinnamon --replace"
Return to tty8 by pressing Ctrl+Alt+F8
@owencm
owencm / blob-to-image.js
Created January 12, 2019 18:01
Convert a blob to an image with JavaScript (e.g. to render blob to canvas)
const blobToImage = (blob) => {
return new Promise(resolve => {
const url = URL.createObjectURL(blob)
let img = new Image()
img.onload = () => {
URL.revokeObjectURL(url)
resolve(img)
}
img.src = url
})
@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active March 12, 2024 22:46
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
@cdesch
cdesch / rails_generator_cheat_sheet.md
Last active March 30, 2024 09:07
Rails Generator CheatSheet

Cheat Sheets are greate but they are not a substitute for learning the framework and reading the documentation as we most certainly have not covered every potential example here. Please refer to the Rails Command Line Docs for more information.

Command Line Generator Info

Reference

You can get all of this information on the command line.

rails generate with no generator name will output a list of all available generators and some information about global options. rails generate GENERATOR --help will list the options that can be passed to the specified generator.

@dmnsgn
dmnsgn / listAllEventListeners.js
Created April 5, 2017 15:40
List all event listeners in a document
const listeners = (function listAllEventListeners() {
let elements = [];
const allElements = document.querySelectorAll('*');
const types = [];
for (let ev in window) {
if (/^on/.test(ev)) types[types.length] = ev;
}
for (let i = 0; i < allElements.length; i++) {
const currentElement = allElements[i];
@evgenyneu
evgenyneu / Shell
Created December 29, 2016 08:01
Calling rollbar deployment webhook
ACCESS_TOKEN=secret
ENVIRONMENT=production
LOCAL_USERNAME=`whoami`
REVISION=`git log -n 1 --pretty=format:"%H"`
curl https://api.rollbar.com/api/1/deploy/ \
-F access_token=$ACCESS_TOKEN \
-F environment=$ENVIRONMENT \
-F revision=$REVISION \
-F local_username=$LOCAL_USERNAME
@Maysora
Maysora / hosts
Last active May 22, 2021 12:38
hosts file for blocking malicious script injection
# Telkom Speedy / Indihome
0.0.0.0 internet-positif.org
0.0.0.0 stat01.u-ad.info
0.0.0.0 cfs.u-ad.info
0.0.0.0 u-ad.info
0.0.0.0 cfs.uzone.id
0.0.0.0 cfs1.uzone.id
0.0.0.0 cfs2.uzone.id
0.0.0.0 kendedes.uzone.id
0.0.0.0 mercusuar.uzone.id