Skip to content

Instantly share code, notes, and snippets.

@AlexanderPavlenko
AlexanderPavlenko / CONFIG_FILE
Created February 5, 2012 11:48
Monitoring IP changes
### IPdetect configuration file
### (c) Mariusz Kaczmarczyk, 2005+
### Content of this file is subject to GPL version 2 license
### (http://www.gnu.org/licenses/gpl.html).
### This is shell include file, use rules for shell script files.
### Values should be VARIABLE='value' (no spaces around equal sign!).
### See 'man 1 bash' for details on how to write shell scripts.
# Force PATH to this value. For security reasons, do not change unless you
@AlexanderPavlenko
AlexanderPavlenko / bip32_rescue.md
Last active April 22, 2023 11:58
bit32_rescue #bitcoin

If you have received a payment to some address, which is not listed in your wallet, but was generated from your XPub — don't worry, it's not lost and can be recovered as follows:

  1. install Electrum (tested on version 2.7.12)
  2. in Electrum, restore wallet with the inaccessible funds from its BIP32 Passphrase (also called Seed, 13 words)
  3. in the restored wallet, switch to Console tab, paste getmasterprivate(), hit enter
  4. visit bip32.org
  5. select "Derive From: BIP32 Key"
  6. paste xprv… from Electrum Console into the "BIP32 Extended Key" field
  7. select "Derivation Path: Custom"
  8. paste m/0/n (or whatever is your gateway's address_derivation_scheme) into the "Custom Path" field, where n is the order's keychain_id
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
Code Terminology Kind Usage Line
$scr scripting additions folder Property of class: domain System Events : Disk-Folder-File Suite 1
%doc music folder Property of class: user domain object System Events : Disk-Folder-File Suite 2
µdoc music folder Enumeration Standard Additions : File Commands 3
ƒhlp help Enumeration Standard Additions : File Commands 4
ƒhlp help folder Enumeration Standard Additions : File Commands 5
ƒlib shared libraries Enumeration Standard Additions : File Commands 6
ƒlib shared libraries folder Enumeration Standard Additions : File Commands 7
ƒmod modem scripts Enumeration Standard Additions : File Commands 8
ƒmod modem scripts folder Enumeration Standard Additions : File Commands 9
@AlexanderPavlenko
AlexanderPavlenko / ypdns.php
Created February 5, 2012 11:40
YPDNS IP updater
#!/usr/bin/php5
<?php
class AUpdater {
private $cookies;
private $credentials = array(
'username' => '...',
'password' => '...',
'mysubmit' => 'Sign+In'
);
@AlexanderPavlenko
AlexanderPavlenko / SkypeAntiSpam.pyw
Created February 5, 2012 12:09
anti-spam for Skype
import Skype4Py
from time import sleep
skype = Skype4Py.Skype()
TRYING = 1
TEXT = {
'QUESTION':"Hello. It's antispam bot. Answer, 2+2=? One figure, please. You have %i trying." % (TRYING),
'ANSWER':"4",
'WIN':"Right. I'll write you soon.",
'AGAIN':"Try one more time.",
'FAIL':"Autoignoring.",
@AlexanderPavlenko
AlexanderPavlenko / vr_blur.py
Created December 21, 2017 14:11
GIMP filter
#!/usr/bin/env python
from gimpfu import *
def vr_blur(image, layer):
# width = 3840
# height = 1.0*width*layer.height / layer.width
# layer = pdb.gimp_drawable_transform_scale(layer, 0, 0, width-1, height-1, TRANSFORM_FORWARD, INTERPOLATION_LANCZOS, 1, 3, TRANSFORM_RESIZE_ADJUST)
# layer.translate(0, 540 - layer.height/2)
# pdb.gimp_layer_flatten(layer)
@AlexanderPavlenko
AlexanderPavlenko / set_7_usb_boot.cmd
Created April 1, 2012 20:22
usbbootfix.bat doesn't help by itself since SP1, but may be involved, so run it before set_7_usb_boot.cmd
@echo off
setlocal EnableExtensions EnableDelayedExpansion
pushd %~dp0
rem set_7_usb_boot.cmd v0.02
rem created by cdob
echo prepare offline windows 7 registry, set USB boot drivers &echo.
set System_Root=\Windows
if not %1.==. set System_Root=%1
@AlexanderPavlenko
AlexanderPavlenko / gist:7099831
Created October 22, 2013 12:32
replace static links to less methods
([^-])url\(.*?/img/([^'")]+).*?\)
$1image-url('$2')
@AlexanderPavlenko
AlexanderPavlenko / gist:6078702
Created July 25, 2013 11:00
values_at vs. map
require 'benchmark'
n = 1000
Benchmark.bm do |bm|
keys = (1..10000).to_a
hash = Hash[keys.zip(keys)]
bm.report do
n.times do
keys.map{|key| hash[key] }