Skip to content

Instantly share code, notes, and snippets.

Working from home

Ariel Sperduti asperduti

Working from home
View GitHub Profile
asperduti /
Created Nov 17, 2021 — forked from ctrl-freak/
Retrieve APK from Non-Rooted Android Device through ADB

None of these suggestions worked for me, because Android was appending a sequence number to the package name to produce the final APK file name (this may vary with the version of Android OS). The following sequence of commands is what worked for me on a non-rooted device:

  1. Determine the package name of the app, e.g. com.example.someapp. Skip this step if you already know the package name.

    adb shell pm list packages

    Look through the list of package names and try to find a match between the app in question and the package name. This is usually easy, but note that the package name can be completely unrelated to the app name. If you can't recognize the app from the list of package names, try finding the app in Google Play using a browser. The URL for an app in Google Play contains the package name. >

asperduti / gist:588890af04577cb7255606bcfc04d073
Created Nov 1, 2021
Recursively replace a string with sed
View gist:588890af04577cb7255606bcfc04d073
find . \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i 's/old_string/new_string/g'
asperduti / How to stream to Facebook Live with
Last active Oct 13, 2021
Command-line to stream to Facebook live with FFmpeg. Specifications for Live on Facebook:
View How to stream to Facebook Live with
ffmpeg -re -y -i input_file.mp4 -c:a copy -ac 1 -ar 44100 -b:a 96k -vcodec libx264 -pix_fmt yuv420p -vf scale=1080:-1 -r 30 -g 60 -tune zerolatency -f flv -maxrate 2000k -preset veryfast "rtmps://$KEY"
asperduti / single-page-app.html
Created May 3, 2020
This is an example to show how simple it can be to implement a Single Page App(SPA) and how to use AJAX to make a request to the server and how to use the HTML5 History API to manipulate the browser’s history. This example is taken from "CS50’s Web Programming with Python and JavaScript"
View single-page-app.html
document.addEventListener('DOMContentLoaded', () => {
// Start by loading first page.
// Set links up to load new pages.
document.querySelectorAll('.nav-link').forEach(link => {
asperduti /
Last active Dec 22, 2018
Bash command to set GPS metadata
exiftool -XMP:GPSLatitude=41.3825 -XMP:GPSLongitude=2.176944 -P -overwrite-original *.jpg
asperduti /
Created May 16, 2018
Customizing hostname for a network
nmcli con modify "NETWORK_NAME" ipv4.dhcp-hostname "CUSTOM_HOSTNAME"
asperduti /
Last active Jun 10, 2018
Set date created/modified of a files in directory with the date in its name
for f in *.jpg; do filename=$(echo $f | cut -d'.' -f 1); date=$(echo $filename | cut -d'_' -f 2)$(echo $filename | cut -d'_' -f 3); date=$(echo $date | cut -c1-12);echo $date; touch -t $date "$f"; done
exiftool "-datetimeoriginal<filename" -d "IMG_%Y%M%D-%H%M%S.%%e" ./
asperduti /
Created Apr 10, 2018 — forked from aembleton/
Convert a Word Document into MD

Converting a Word Document to Markdown in One Move

The Problem

A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.

Installing Pandoc

On a mac you can use homebrew by running the command brew install pandoc.

The Solution