Skip to content

Instantly share code, notes, and snippets.

@donpdonp
donpdonp / wbc.rb
Created August 14, 2014 17:32
wallet dump balance check
#!/usr/bin/env ruby
## Query the balance of every address in a wallet dump/backup
## $ bitcoin-cli dumpwallet ~/wallet.dump
## $ ./wbc.rb ~/wallet.dump
require 'open-uri'
satoshi = 0.00000001
addresses = File.open(ARGV[0]).read.gsub("\n"," ").split.map{|a| a.split('=')}.select{|a| a[0]=='addr'}.map{|a|a[1]}
$OU="OU=TheOUName,DC=yourdomain,DC=com"
$ShadowGroup="CN=ShadowGroupName,OU=TheOUName,DC=yourdomain,DC=com"
Import-Module ActiveDirectory
(Get-ADGroup -Identity $ShadowGroup -properties members).Members | Get-ADUser | Where-Object {$_.distinguishedName –NotMatch $OU} | ForEach-Object {Remove-ADPrincipalGroupMembership –Identity $_ –MemberOf $ShadowGroup –Confirm:$false}
Get-ADUser –SearchBase $OU –SearchScope OneLevel –LDAPFilter "(!memberOf=$ShadowGroup)" | ForEach-Object {Add-ADPrincipalGroupMembership –Identity $_ –MemberOf $ShadowGroup}
@clux
clux / prompt.sh
Last active February 2, 2022 21:20
git-prompt-powerline-style
#!/bin/bash
export TERM=xterm-256color
show_cwd() {
local dir_limit="3"
local truncation=""
local first_char
local part_count=0
local formatted_cwd=""
local dir_sep=""
@PSJoshi
PSJoshi / fprobe-nfsen-install.txt
Last active June 29, 2022 05:54
nfsen-with-plugins installation
Installing fprobe/nfdump/nfsen with plugins like PortTracker:
-------------------------------------------------------------
1) Make sure that SELinux is disabled.
vi /etc/selinux/config
set SELINUX=disabled
2) Start and enable httpd at boot
# service httpd start
@Jiab77
Jiab77 / ffmpeg.md
Last active August 9, 2022 21:40
Compilation FFMpeg / NVENC + QSV + VAAPI + VDPAU + OpenCL

Compilation FFMpeg / NVENC + NVRESIZE + QSV + VAAPI + VDPAU + OpenCL

nVidia nvresize patch is outdated and not more compatible to the latest version of FFmpeg, so it's not included in this documentation.

(even if I've passed a lot of time at trying to make it compile... without any success)

Please don't rely on this page: https://developer.nvidia.com/ffmpeg, the implementation is a hack and was never been added to the main FFmpeg tree.

See:

@rumpelsepp
rumpelsepp / install-pacaur.sh
Last active November 20, 2022 13:04
A small script for arch linux which builds and installs "pacaur" automatically
#!/usr/bin/bash -l
#
# The MIT License (MIT)
#
# Copyright (c) 2015-2017 Stefan Tatschner
#
# 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
@DraTeots
DraTeots / synology_zerotier.md
Last active March 8, 2023 20:20
Sinology DS211j ZeroTier configuration
#!/usr/bin/perl -w
#
# Uses ipmitool(1) to display a string of text on
# the front chassis display of Dell PowerEdge
# servers.
#
# Jesper Nyerup <nyerup@gmail.com>
my $ipmitool = '/usr/bin/ipmitool';
#! /bin/sh
case "$1" in
start)
if ( pidof zerotier-one )
then echo "ZeroTier-One is already running."
else
echo "Starting ZeroTier-One" ;
/opt/bin/zerotier-one -d ;
echo "$(date) Started ZeroTier-One" >> /opt/var/log/zerotier-one.log ;
@msm595
msm595 / bitwalletrecover.py
Last active April 9, 2024 16:48
bitwalletrecover.py - recover compressed private keys from your bitcoin wallet. Requires python3, pycoin (https://pypi.python.org/pypi/pycoin), and base58 (https://pypi.python.org/pypi/base58).
import re
import hashlib
import base58
from pycoin.ecdsa import generator_secp256k1, public_pair_for_secret_exponent
def bytetohex(byteStr):
return ''.join( [ "%02X" % x for x in byteStr ] ).strip()
litecoin = [b"\x30", b"\xb0"]
bitcoin = [b"\x00", b"\x80"]