Skip to content

Instantly share code, notes, and snippets.

@rraallvv
rraallvv / Uninstall-pkg.md
Last active September 10, 2017 21:37 — forked from githubutilities/Uninstall-pkg.md
Uninstall pkg manually in OS X

Mac Uninstall pkg Manually

  • using pkgutil
# list all your installed packages
pkgutil --pkgs

# show your package info
pkgutil --pkg-info 
@rraallvv
rraallvv / video_stabilization.sh
Last active October 20, 2017 23:12
video_stabilization.sh
#!/bin/bash
mkdir temp
while read -d $'\0' file; do
file=$(echo $file | sed -n 's/\.\/\(.*\)/\1/p')
#echo $file
#continue
ffmpeg -i $file -y -nostdin -vf vidstabdetect=stepsize=6:shakiness=8:accuracy=9:result=transform_vectors.trf -f null -
ffmpeg -i $file -y -nostdin -vf vidstabtransform=input=transform_vectors.trf:zoom=1:smoothing=30,unsharp=5:5:0.8:3:3:0.4 -vcodec libx264 -preset slow -tune film -crf 18 -acodec copy temp/$file
done < <(find . -not -name ".*" -name "*.mp4" -type f -print0)
rm transform_vectors.trf
@rraallvv
rraallvv / ffmpg_mp3_normalization.sh
Last active March 2, 2022 07:56
FFMPEG mp3 normalization
#!/bin/bash
find . -type f -not -name ".*" -print0 | while read -d $'\0' file; do
echo $file
level=$(ffmpeg -y -nostdin -i $file -af "volumedetect" -vn -sn -dn -f null /dev/null 2>&1 | grep max_volume | sed -n 's/.*max_volume: \([^ ]*\) .*/\1/p')
gain=$(bc -l <<< "-($level)")
echo "${gain}dB"
ffmpeg -y -nostdin -loglevel panic -i $file -af "volume=${gain}dB" temp.mp3
rm $file
mv temp.mp3 $file
done
$ tns doctor --log trace
Loading extensions.
execFile: /Users/user/Library/Android/sdk/platform-tools/adb "help"
Exec uname -a
stdout: Darwin Mac.local 16.7.0 Darwin Kernel Version 16.7.0: Mon Nov 13 21:56:25 PST 2017; root:xnu-3789.72.11~1/RELEASE_X86_64 x86_64
stderr:
Exec npm -v
stdout: 5.6.0
$ tns doctor --log trace
Loading extensions.
execFile: /Users/user/Library/Android/sdk/platform-tools/adb "help"
Exec uname -a
stdout: Darwin Mac.local 16.7.0 Darwin Kernel Version 16.7.0: Mon Nov 13 21:56:25 PST 2017; root:xnu-3789.72.11~1/RELEASE_X86_64 x86_64
stderr:
Exec npm -v
stdout: 5.6.0
@rraallvv
rraallvv / gist:75df1a13f2d3b5ead222b4a6464aa76e
Last active January 12, 2018 13:29 — forked from omegasoft7/gist:ec2285ae5a873d6f780b
Change Android Emulator Storage Size
# Navigate to AVD
cd ~/.android/avd/<device dir>
# Delete old image
#rm userdata-qemu.*
# Re-size the images
e2fsck -f userdata-qemu.img
resize2fs userdata-qemu.img 512M
e2fsck -f userdata.img
@rraallvv
rraallvv / upload-github-release-asset.sh
Created January 14, 2018 00:07 — forked from stefanbuck/upload-github-release-asset.sh
Script to upload a release asset using the GitHub API v3.
#!/usr/bin/env bash
#
# Author: Stefan Buck
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447
#
#
# This script accepts the following parameters:
#
# * owner
# * repo
The layout of keyboards varies per country, with some countries having multiple
common layouts. Please select the country of origin for the keyboard of this
computer.
1. Afghani 48. Irish
2. Albanian 49. Italian
3. Amharic 50. Japanese
4. Arabic 51. Japanese (PC-98xx Series)
5. Arabic (Morocco) 52. Kazakh
6. Arabic (Syria) 53. Khmer (Cambodia)
@rraallvv
rraallvv / pre-commit
Last active March 30, 2018 19:09
Git hook to convert hard tabs and remove spaces before line ending
#!/bin/sh
git diff --diff-filter=d --name-only --cached | grep -v "Resource.designer.cs" -E | grep -E "\.cs$|\.xml$|\.xaml$|\.axml$" | while read -r file; do
# Convert soft tabs to hard ones
perl -pi -e "s/\G {4}/\t/g" $file
# Remove additional spaces before the end of line
perl -pi -e "s/[ \t]$//g" $file
# Add newline before EOF if missing

None of these answers give a full useable workflow, I want to git push, not send an email! Here's how to do it properly but there's a bit of setup required. Instructions are for OSX

#Publishing anonymously to github with tor+ssh

  1. Download tor browser bundle AND the tor command line proxy

     brew install tor
     brew cask install torbrowser
    

1.1 In tor browser, Create a new email address ( I used hmamail).