Skip to content

Instantly share code, notes, and snippets.

@kyberdrb
kyberdrb / android-backup-apk-and-datas.md
Created November 27, 2021 15:27 — forked from AnatomicJC/android-backup-apk-and-datas.md
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Fetch application APK

To get the list of your installed applications:

@kyberdrb
kyberdrb / desktop_chromium_flags.md
Created December 31, 2020 21:29 — forked from ibLeDy/desktop_chromium_flags.md
Modified chromium flags
Updated: Nov 19, 2020
Chromium: 87.0.4280.66 (Official Build) (64-bit)
OS: Linux 5.3.0-64-generic (Ubuntu 19.10)

Override software rendering list - Enabled

Overrides the built-in software rendering list and enables GPU-acceleration on unsupported system configurations. – Mac, Windows, Linux, Chrome OS, Android

@kyberdrb
kyberdrb / vimeo-downloader.js
Created December 3, 2020 22:01 — forked from aik099/vimeo-downloader.js
Download video from Vimeo (chopped m4s files)
// 1. Open the browser developper console on the network tab
// 2. Start the video
// 3. In the dev tab, locate the load of the "master.json" file, copy its full URL
// 4. Run: node vimeo-downloader.js "<URL>"
// (done automatically now) 5. Combine the m4v and m4a files with mkvmerge
const fs = require('fs');
const url = require('url');
const https = require('https');
const { exec } = require('child_process');
@kyberdrb
kyberdrb / switch_audio_output_to_headphones.sh
Created November 11, 2020 10:02
For list of audio outputs/sinks/ports use the command `pactl list sinks |& grep -E "Sink|Ports|analog-ou"`[https://unix.stackexchange.com/questions/459240/changing-audio-output-from-terminal/459246#459246]
pactl set-sink-port 0 analog-output-headphones
@kyberdrb
kyberdrb / play.sh
Created April 22, 2020 19:50
Update modification time of a media file and play it. Works together with 'ls_with_duration_sorted_by_modification_time.sh'
#!/bin/sh
MEDIA=$1
touch "$MEDIA"
parole "$MEDIA" &
@kyberdrb
kyberdrb / ls_with_duration_sorted_by_modification_time.sh
Last active May 2, 2020 16:29
Sort media files by modification time and display its duration. Works together with 'play.sh'
#!/bin/sh
find_filename_with_most_characters() {
local max_number_of_characters=0
for file in *.ogg
do
if [ "$(echo "$file" | wc -c)" -gt "$max_number_of_characters" ]
then
max_number_of_characters=$(echo "$file" | wc -c)
@kyberdrb
kyberdrb / xclip-copy-to-clipboard.md
Created April 16, 2020 13:43 — forked from Brainiarc7/xclip-copy-to-clipboard.md
Using xclip to copy terminal content to the clip board on Linux

Using xclip to copy terminal content to the clip board:

Say you want to pipe shell output to your clipboard on Linux. How would you do it? First, choose the clipboard destination, either the Mouse clip or the system clipboard.

For the mouse clipboard, pipe straight to xclip:

echo 123 | xclip

For the system clip board, pipe to xclip and select clip directly:

How to download your Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)[1] export extension. Save it to file udemy-cookies.txt
  3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {path_to_cookies_file} with respective paths.
$ youtube-dl {course_link} --cookies {path_to_cookies_file}
@kyberdrb
kyberdrb / toggle_proxy.sh
Created March 29, 2019 19:01
Toggle proxy under Linux
#!/bin/bash
FILE=/etc/environment
FILE_BAK=/etc/environment.bak
FILE_TMP=/etc/environment.tmp
sudo mv $FILE $FILE_TMP
sudo mv $FILE_BAK $FILE
sudo mv $FILE_TMP $FILE_BAK
cat $FILE
@kyberdrb
kyberdrb / connect_to_network.sh
Created March 29, 2019 18:56
Connect to Wi-Fi network without network manager
#!/bin/bash
SSID=$1
PASSWD=$2
su -c 'wpa_supplicant -B -i wlo1 -c <(wpa_passphrase $SSID \
"$PASSWD") && \
dhcpcd wlo1'