Skip to content

Instantly share code, notes, and snippets.

@fardjad
fardjad / doublecmd-explorer-integration.reg
Last active April 10, 2022 09:28
[doublecmd-explorer-integration.reg] Double Commander Explorer Integration #windows #registry #doublecmd
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Drive\shell]
@="open"
[HKEY_CLASSES_ROOT\Drive\shell\open]
[HKEY_CLASSES_ROOT\Drive\shell\open\command]
@="C:\\Program Files\\Double Commander\\doublecmd.exe -C \"%1\""
@fardjad
fardjad / dsl-lte-auto-switch-setup.md
Last active January 17, 2024 16:11
[DSL/LTE Auto-switch Setup] #openwrt #dsl #lte #multiwan

DSL/LTE Auto-switch Setup

Synopsis

This is how I setup my home router to share a 4G/LTE connection at day and switch to a DSL connection overnight.

It also falls back to DSL connection whenever the 4G/LTE connection dies.

Why?

@fardjad
fardjad / bitmeter.service
Last active February 7, 2019 22:17
[bitmeter.service] Modified "/usr/lib/systemd/system/bitmeter.service" file for ArchLinux #archlinux #systemd #bitmeter
[Unit]
Description=Packet Capture Service for BitMeter-OS
Requires=network-online.target
ConditionPathExists=/var/lib/bitmeter/bitmeter.db
After=syslog-ng.target network-online.target
[Service]
ExecStart=/usr/bin/bmcapture
Type=idle
StandardError=syslog
@fardjad
fardjad / center-active-window.ahk
Last active June 29, 2021 03:19
[center-active-window.ahk] An AutoHotkey script to make WinKey+C center active window #autohotkey #windows
; Courtesy of http://superuser.com/a/403191
^#c::
WinGetTitle, windowName, A
CenterWindow(windowTitleVariable) {
WinGetPos,,, Width, Height, %windowTitleVariable%
WinMove, %windowTitleVariable%,, (A_ScreenWidth - Width) / 2, (A_ScreenHeight - Height) / 2
}
@fardjad
fardjad / ms-aio-media-keyboard-workaround.ahk
Last active February 7, 2019 22:19
[ms-aio-media-keyboard-workaround.ahk] Microsoft AIO Media Keyboard missing keys workaround #autohotkey #windows
/*
* Copyright (c) 2015 Fardjad Davari
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@fardjad
fardjad / .!php-sample-with-grunt-composer-phpunit-and-continuos-testing
Last active February 8, 2019 09:12
[PHP sample with Grunt, Composer, PHPUnit, and continuos testing] #php #grunt #composer #phpunit
@fardjad
fardjad / .!password-authentication-with-mongoose
Last active April 29, 2020 00:06
[Password Authentication with Mongoose] #nodejs #mongodb #authentication
@fardjad
fardjad / iterm2-keybindings-for-better-navigation.md
Last active February 7, 2019 22:24
[iTerm2 key bindings for better navigation] #iterm2 #macos

⌘→: 0x05

⌘←: 0x01

⌘←Delete: 0x15

⌥→: ^[f

⌥←: ^[b

@fardjad
fardjad / batch-m4a-to-mp3.md
Last active February 28, 2024 16:37
[How to Convert m4a Files to mp3, Preserving Bitrate and ID3 Tags Using ffmpeg] #ffmpeg #bash

How to convert m4a files to mp3, preserving bitrate and id3 tags using ffmpeg

Prerequisites

  1. ffmpeg
  2. cygwin (on windows)

Commands

cd /path/to/m4a/files
mkdir out
for f in *.m4a; do 
@fardjad
fardjad / rpi-toolchain.md
Last active August 4, 2021 13:48
[How to Build an ARM Toolchain on OSX for RaspberryPI] WIP #raspberrypi #toolchain #osx #arm

Building an ARM Toolchain on OSX for RaspberryPI

Requirements

  1. MacPorts

     sudo port selfupdate
     sudo port upgrade outdated
    
  2. GCC prerequisites