Skip to content

Instantly share code, notes, and snippets.

Aldo Ridhoni aldoridhoni

View GitHub Profile
View convert.sh
#!/bin/bash
for input in "$@"; do
output="${input%%.*}.avi"
# does not work if filename has multiple dot
ffmpeg -i "$input" -c:v mpeg4 -vtag DIVX -s 640x480 -qscale:v 10 -c:a libmp3lame -qscale:a 0 "$output"
done
@aldoridhoni
aldoridhoni / org-babel-tangle
Created May 18, 2019
Improve org-babel-tangle
View org-babel-tangle
#!/usr/bin/env python3
# -*- mode: python -**
import fileinput, os
dests = dict()
"""A dictionary associating absolute file names and file objects."""
counter = dict()
"""A dictionary associating file objects with count of emitted
@aldoridhoni
aldoridhoni / remove.sh
Created Apr 21, 2019
Manually delete gnome shell extension
View remove.sh
# Using gdbus
gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Extensions.UninstallExtetension "(TopIcons@phocean.net)"
##
gnome-shell-extension-tool -d no-title-bar@franglais125.gmail.com
@aldoridhoni
aldoridhoni / tree-bin
Last active Dec 18, 2018
F609 folder tree
View tree-bin
.
├── acs_cli
├── acsd
├── ash
├── bcmlog
├── bdmf_shell
├── bobtest
├── brctl
├── bs
├── busybox
@aldoridhoni
aldoridhoni / batch_dl.sh
Last active Dec 18, 2018
Batch Download ALOS from JAXA
View batch_dl.sh
#!/bin/bash
# Indonesia
for long in {090..160..5}; do
# north side
for lat in {020..000..-5}; do
file="N${lat}E${long}_N$(printf '%03d' $((10#$lat + 05)))E$(printf '%03d' $((10#$long + 05))).tar.gz"
wget -nc ftp://ftp.eorc.jaxa.jp/pub/ALOS/ext1/AW3D30/release_v1804/$file
done
@aldoridhoni
aldoridhoni / scribus-sequential-numbering.py
Last active Oct 27, 2018
Scribus script for looping all textbox and created number for doorprize.
View scribus-sequential-numbering.py
page = 1
pagenum = scribus.pageCount()
content = []
number = 0
copies = 2 ### how many times number are displayed
current_pos = 1
while (page <= pagenum):
scribus.gotoPage(page)
d = scribus.getPageItems()
for item in d:
@aldoridhoni
aldoridhoni / zte_extract.py
Created Aug 1, 2018 — forked from ndunks/zte_extract.py
Modem Indihome ZTE F609 Config Extract and Repack
View zte_extract.py
#!/usr/bin/env python
# https://reverseengineering.stackexchange.com/a/13395
import sys
import binascii
import struct
import zlib
if (len(sys.argv) <= 1):
print('USAGE:\n%s [configBak.cfg|config.bin]' % sys.argv[0])
exit(1)
@aldoridhoni
aldoridhoni / gmaps-dl.sh
Created Jul 30, 2018
Download Google Maps Images
View gmaps-dl.sh
#!/bin/bash
function show_help
{
echo "Usage: $0 (-x xcoord) (-y ycoord) (-l level)"
echo " [-r x width] [-s y width] -h for help"
}
if [ $# -le 1 ]; then
show_help
@aldoridhoni
aldoridhoni / batch_run.sh
Created Apr 15, 2018
Convert MOD video to mp4 and read some metadata from MOI file.
View batch_run.sh
#!/bin/sh
for vid in *.MOD; do python3 convert_mod.py $vid; done
@aldoridhoni
aldoridhoni / hide-div.md
Last active May 1, 2018
Hide Ads Div Spotify Client
View hide-div.md

Copy resource from spotify app folder

  • cp /usr/lib64/spotify-client/Apps/zlink.spa ~/

Unzip

  • unzip zlink.spa -d zlink

Find file index.html.

  • Search for `view-billboard-ad'
  • Add data-bind="visible: null"
  • Save file

Zip folder

  • cd zlink; zip --quiet --recurce-paths ../zlink.spa ./
You can’t perform that action at this time.