Skip to content

Instantly share code, notes, and snippets.

@ShannonScott
ShannonScott / Video Screen Capture with GStreamer.md
Created October 30, 2019 16:28
[Video Screen Capture with GStreamer] Capture a Linux desktop window video with gsteramer. #tags: gstreamer, linux, xwindows, video

Capture a video of a given X Window with gstreamer.

X Window ID

Get the target window ID with the following:

xwininfo
@mdPlusPlus
mdPlusPlus / badblocks.txt
Last active March 16, 2025 00:23
How to check new hard drives with badblocks
badblocks -b 4096 -p 0 -s -t 0 -v -w DEVICE [LAST_BLOCK] [FIRST_BLOCK]
-b block_size
-p num_passes
-s Show the progress of the scan
-t test_pattern
-v Verbose mode
-w Use write-mode test
@soygul
soygul / youtube-upload.js
Last active March 7, 2025 04:06
YouTube video uploader using JavaScript and Node.js
// YouTube API video uploader using JavaScript/Node.js
// You can find the full visual guide at: https://www.youtube.com/watch?v=gncPwSEzq1s
// You can find the brief written guide at: https://quanticdev.com/articles/automating-my-youtube-uploads-using-nodejs
//
// Upload code is adapted from: https://developers.google.com/youtube/v3/quickstart/nodejs
const fs = require('fs');
const readline = require('readline');
const assert = require('assert')
const {google} = require('googleapis');
@n-ramdi
n-ramdi / worker.js
Created April 29, 2021 08:27
Cloudflare worker to bypass Instagram new cross-origin policy on images (fixes net :: ERR_BLOCKED_BY_RESPONSE )
// Instagram started setting cross-origin-resource-policy: same-origin when it sees bad referer headers.
// this change leads to ERR_BLOCKED_BY_RESPONSE error and broken images if instagram image is embedded to external website.
// to mitigate this, simple image proxy can be used.
// Steps to install this worker:
// 1. Create CNAME cdn.<yourdomain.com> in your CloudFlare panel
// 2. Create new worker and put the code below into the worker code
// 3. Setup worker route so the worker launches on your cdn. subdomain.
// 4. Modify your image urls from
// https://scontent-arn2-1.cdninstagram.com/v/t51.2885-15/sh0xxx.jpg
// to:
@ucjonathan
ucjonathan / xhr-capture.js
Created April 29, 2021 13:01
XHR Logging
(function(options) {
// Init options if not specified
options = options || {
"capturePayload": false
};
// Store a reference to the native method
let oldOpen = XMLHttpRequest.prototype.open;
var xhrlogcounter = 1;
@lucanello
lucanello / rclone_backup.py
Last active September 10, 2024 21:13
Python Rclone Script with Telegram and InfluxDB Reporting
# Python Rclone Script with Telegram and InfluxDB Reporting
# - This Script backups your data to any rclone location (see rclone.org)
# - You can execute scripts, commands and database dumps before running a single rclone command
# - It sends automatic error reports and summaries
# - It saves all statistics and operations to an Influx database
# - The data can be used for visualizations in e.g. Grafana
# - You can automate it by using cron
# Created by: Luca Koroll - https://github.com/lucanello
# Last update: 2021-07-04
@Neocky
Neocky / Linux-colored-shell.md
Last active February 10, 2023 00:04
Linux Colored Shell

Linux Colored Shell

Color scheme based of One Dark Pro

image

How to

  1. Open file: nano ~/.bashrc
  2. Add to end of file:
PS1="\[$(tput bold)\]\[\033[38;5;9m\]\u\[$(tput sgr0)\]\[\033[38;5;7m\]@\[$(tput bold)\]\[\033[38;5;171m\]\H\[$(tput sgr0)\]\[\033[38;5;7m\]:\[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;41m\]\w\[$(tput sgr0)\]\\$ \[$(tput sgr0)\]"