Skip to content

Instantly share code, notes, and snippets.

@fardjad
fardjad / kernel-3.10.21-armv6-qemu.patch
Last active Feb 7, 2019
[kernel-3.10.21-armv6-qemu.patch] Kernel 3.10.21-armv6 Patch for QEMU #kernel #arm #linux #qemu #raspberrypi
View kernel-3.10.21-armv6-qemu.patch
Make the "Arm Versatile" board even more versatile, for QEMU, which can
stick weird processors into things that were never meant to receive them.
Based on: http://unicorn.drogon.net/rpi/linux-arm.patch
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -71,7 +71,7 @@ config CPU_ARM9TDMI
# ARM920T
config CPU_ARM920T
@fardjad
fardjad / linux-3.10.21-qemu.config
Last active Feb 7, 2019
[linux-3.10.21-qemu.config] Linux/arm 3.10.21 Kernel Configuration for QEMU. Apply https://gist.github.com/fardjad/7771673 before using this config. #kernel #arm #linux #qemu #raspberrypi
View linux-3.10.21-qemu.config
#
# Linux/arm 3.10.21 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_MIGHT_HAVE_PCI=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
CONFIG_HAVE_PROC_CPU=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_LOCKDEP_SUPPORT=y
@fardjad
fardjad / rpi-toolchain.md
Last active Dec 26, 2019
[How to Build an ARM Toolchain on OSX for RaspberryPI] WIP #raspberrypi #toolchain #osx #arm
View rpi-toolchain.md

Building an ARM Toolchain on OSX for RaspberryPI

Requirements

  1. MacPorts

     sudo port selfupdate
     sudo port upgrade outdated
    
  2. GCC prerequisites

@fardjad
fardjad / batch-m4a-to-mp3.md
Last active Apr 9, 2021
[How to Convert m4a Files to mp3, Preserving Bitrate and ID3 Tags Using ffmpeg] #ffmpeg #bash
View batch-m4a-to-mp3.md

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 / iterm2-keybindings-for-better-navigation.md
Last active Feb 7, 2019
[iTerm2 key bindings for better navigation] #iterm2 #macos
View iterm2-keybindings-for-better-navigation.md

⌘→: 0x05

⌘←: 0x01

⌘←Delete: 0x15

⌥→: ^[f

⌥←: ^[b

@fardjad
fardjad / .!password-authentication-with-mongoose
Last active Apr 29, 2020
[Password Authentication with Mongoose] #nodejs #mongodb #authentication
@fardjad
fardjad / .!php-sample-with-grunt-composer-phpunit-and-continuos-testing
Last active Feb 8, 2019
[PHP sample with Grunt, Composer, PHPUnit, and continuos testing] #php #grunt #composer #phpunit
@fardjad
fardjad / ms-aio-media-keyboard-workaround.ahk
Last active Feb 7, 2019
[ms-aio-media-keyboard-workaround.ahk] Microsoft AIO Media Keyboard missing keys workaround #autohotkey #windows
View ms-aio-media-keyboard-workaround.ahk
/*
* 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 / center-active-window.ahk
Last active Jun 29, 2021
[center-active-window.ahk] An AutoHotkey script to make WinKey+C center active window #autohotkey #windows
View center-active-window.ahk
; 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 / bitmeter.service
Last active Feb 7, 2019
[bitmeter.service] Modified "/usr/lib/systemd/system/bitmeter.service" file for ArchLinux #archlinux #systemd #bitmeter
View bitmeter.service
[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