Skip to content

Instantly share code, notes, and snippets.

@anshumanb
anshumanb / jstestdriver
Created December 29, 2011 00:55
My AUR PKGBUILDs
# Maintainer: Leo von Klenze <aur@leo.von-klenze.de>
pkgname=jstestdriver
pkgver=1.3.3d
pkgrel=0
pkgdesc="The goal of JsTestDriver is to build a JavaScript test runner."
arch=('any')
url="http://code.google.com/p/js-test-driver/"
depends=('java-runtime')
license=('Apache License 2.0')
@anshumanb
anshumanb / Java 1.3
Created August 12, 2012 23:26
Java PKGBUILDs
# Maintainer: Anshuman Bhaduri <anshuman (dot) bhaduri 0 (at) gmail (dot) com>
pkgname=j2sdk3
pkgver=3.1.20
_pkgver=${pkgver//./_}
pkgrel=1
pkgdesc="Java 3 Development Kit"
url=http://www.oracle.com/technetwork/java/javase/downloads/index.html
arch=('i686' 'x86_64')
license=(custom)
@anshumanb
anshumanb / buildout.cfg
Created December 17, 2012 04:29
Buildout for Web dev trial
[buildout]
download-cache = downloads
unzip = true
parts =
python
django
node
ruby
rubygems
develop =
@anshumanb
anshumanb / from-guest.sh
Last active December 10, 2022 19:25
Disable and enable VirtualBox guest-host time sync
# Disable time sync from guest
/etc/init.d/vboxadd-service stop
# Enable time sync from guest
/etc/init.d/vboxadd-service start
@anshumanb
anshumanb / login_win7
Created November 20, 2015 02:02
Auto-login for Windows 7 VirtualBox VM. Uses gnome-keyring to retrieve password.
#!/usr/bin/python2
"""
This code is old. I would probably use secret-tool and
Python's subprocess to extract the password now.
"""
import sys
import time
import gnomekeyring as gk
@anshumanb
anshumanb / json.js
Last active December 19, 2021 23:27
NodeJS read/write JSON
const fs = require("fs/promises");
const readJson = async (filePath) =>
JSON.parse(await fs.readFile(filePath, "utf-8"));
const writeJson = async (filePath, data) =>
fs.writeFile(filePath, JSON.stringify(data, null, 2).concat("\n"), "utf-8");
@anshumanb
anshumanb / commit-to-repo.yml
Created April 18, 2021 06:31
Commit the result of a Github Actions job to its repository
# Adapted from
# https://github.com/actions/checkout/blob/25a956c84d5dd820d28caab9f86b8d183aeeff3d/README.md#push-a-commit-using-the-built-in-token
# https://stackoverflow.com/a/8123841/822292
name: Commit the result of this Github Actions job to this repository
on: push
jobs:
my-job:
runs-on: ubuntu-latest
steps:
- name: Checkout code
@anshumanb
anshumanb / caps-lock-is-left-ctrl.reg
Last active July 19, 2021 02:54
Remap Windows 10 Ctrl, Win keys
Windows Registry Editor Version 5.00
; https://gist.github.com/joshschmelzle/5e88dabc71014d7427ff01bca3fed33d
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00
@anshumanb
anshumanb / windows-10-focus-follows-mouse.md
Created July 20, 2021 05:54
Set up focus follows mouse on Windows 10
  1. Navigate to Control Panel > Ease of Access > Ease of Access Center > Make the mouse easier to use
  2. Check "Activate a window by hovering over it with the mouse" and hit OK
  3. In the registry editor, navigate to Computer\HKEY_CURRENT_USER\Control Panel\Desktop
  4. Update ActiveWndTrkTimeout to 300
  5. Update UserPreferencesMask by subtracting 40 bits from the first hex value e.g. DF -> 9F
  6. Log out and log back in

Source: https://winaero.com/enable-xmouse-window-tracking-windows-10/

@anshumanb
anshumanb / settings.json
Last active May 20, 2022 11:51
My Windows Terminal config
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions": [
{
"command": {
"action": "quakeMode"
},
"keys": "alt+`"
},
{