Skip to content

Instantly share code, notes, and snippets.

View kxalex's full-sized avatar
🏠
Working from home

Oleksii Shurubura kxalex

🏠
Working from home
View GitHub Profile
@pdxmph
pdxmph / save_chrome_url.rb
Created November 6, 2011 03:47
Add a URL from Chrome to Safari's reading list
#!/usr/bin/env ruby -wKU
require "rubygems"
require "appscript"
include Appscript
chrome = app("Google Chrome")
safari = app("Safari")
chrome_tab = chrome.windows[1].active_tab
@xbeta
xbeta / README.md
Last active July 11, 2024 15:13
Macbook Pro Bluetooth + WiFi 2.4GHz interference fix for Mavericks
@runspired
runspired / leak.js
Created November 5, 2015 06:35
ES6 Fat Arrow ( => ) functions can cause memory leaks when used with Event Handlers.
class Foo {
constructor(element) {
this.element = element;
this.setupHandlers();
}
doFoo() {}
setupHandlers() {
@jamesmacwhite
jamesmacwhite / ffmpeg_mkv_mp4_conversion.md
Last active July 9, 2024 09:52
Easy way to convert MKV to MP4 with ffmpeg

Converting mkv to mp4 with ffmpeg

Essentially just copy the existing video and audio stream as is into a new container, no funny business!

The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.

With ffmpeg this can be achieved with -c copy. Older examples may use -vcodec copy -acodec copy which does the same thing.

These examples assume ffmpeg is in your PATH. If not just substitute with the full path to your ffmpeg binary.

Single file conversion example

@duluca
duluca / npm-scripts-for-docker.md
Last active April 8, 2024 09:52
npm scripts for Docker

These are generic npm scripts that you can copy & paste into your package.json file as-is and get access to convinience scripts to manage your Docker images all in one place.

How to Use

npm i -g mrm-task-npm-docker
npx mrm npm-docker

Contribute

Here's the code repository https://github.com/expertly-simple/mrm-task-npm-docker

@abl
abl / .zshrc
Last active December 3, 2023 18:41
abl's universal .zshrc
if [[ -f "/mnt/c/WINDOWS/system32/wsl.exe" ]]; then
# We're in WSL, which defaults to umask 0 and causes issues with compaudit
umask 0022
if [[ "${PWD}" = "/mnt/c/Users/${USER}" ]]; then
# We're in a default WSL shell
cd "${HOME}"
fi
fi
if [[ ! -d "$HOME/.zinit" ]]; then
@MatthewVance
MatthewVance / unbound.conf
Last active May 6, 2024 21:18
Config for running Unbound as a caching DNS forwarder (performance settings optimized for Raspberry Pi 2).
server:
###########################################################################
# BASIC SETTINGS
###########################################################################
# Time to live maximum for RRsets and messages in the cache. If the maximum
# kicks in, responses to clients still get decrementing TTLs based on the
# original (larger) values. When the internal TTL expires, the cache item
# has expired. Can be set lower to force the resolver to query for data
# often, and not trust (very large) TTL values.
cache-max-ttl: 86400
@Saruspete
Saruspete / checkport.sh
Created February 9, 2021 15:47
Check that no process is listening on ephemeral port range
#!/usr/bin/env bash
# Get min/max port range from sysctl
prange="$(sysctl net.ipv4.ip_local_port_range| awk '{print $3,$4}')"
pmin="${prange% *}"
pmax="${prange#* }"
# TODO: ignore ports in sysctl net.ipv4.ip_local_reserved_ports
ss --listen --numeric --tcp --process | awk -v pmin=$pmin -v pmax=$pmax '