Skip to content

Instantly share code, notes, and snippets.

@rraallvv
rraallvv / lingorado_ipa_transcription.py
Last active December 27, 2020 23:29
Lingorado IPA phonetic transcription
#!/usr/bin/python
import requests
from lxml import html
import re
from random import randint
from time import sleep
import sys
import random
@rraallvv
rraallvv / nimiq-insight.js
Created June 28, 2020 22:31
Nimiq Insight API
const START = Date.now();
const Nimiq = require('@nimiq/core');
require('dotenv').config();
const config = {
protocol: "dumb",
network: process.env.NETWORK || "main",
type: "nano"
};
@rraallvv
rraallvv / open-cloudflare-ufw.sh
Last active May 20, 2020 13:45
Open ports to Cloudflare with UFW
#!/usr/bin/env bash
# Instructions:
#
# 1) Place this script in the /root/ directory, give it proper permissions.
# $ sudo chmod +x /root/open-cloudflare.sh
#
# 2) Open the cron job editor
# $ sudo crontab -e
#
@rraallvv
rraallvv / index.html
Last active April 18, 2020 03:29
socket.io example
<html>
<body>
<script src="socket.io.js"></script>
<script>
eventToListenTo = 'tx'
room = 'inv'
packages = 0;
var socket = io("http://localhost:8000/");
socket.on('connect', function() {
@rraallvv
rraallvv / enable-ssl-wordpress-with-nginx.md
Last active January 30, 2020 21:29
Enable SSL for WordPress with Nginx

In order to use Wordpress in SSL with NGINX add

$_SERVER['HTTPS']='on';

to wp-config.php just before

require_once(ABSPATH . 'wp-settings.php');
@rraallvv
rraallvv / benchmarking.sh
Last active January 30, 2020 21:29
Benchmarking
# CPU
sysbench --test=cpu --cpu-max-prime=1000 run
# Disk
# Random read write
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=1M --readwrite=randrw --rwmixread=75
# Random read
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=1M --readwrite=randread
# Random write
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=1M --readwrite=randwrite
@rraallvv
rraallvv / space_view3d_simple_align.py
Created April 11, 2014 16:36
Align Selected Objects to Active Object
# AlingTools.py (c) 2009, 2010 Gabriel Beaudin (gabhead)
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
@rraallvv
rraallvv / space_view3d_turntable_any_up.py
Last active January 29, 2019 11:04
Enable turntable rotation with any axis up, the axis that is most aligned vertically is the new up axis of the turntable rotation until a new mouse gesture is initiated by either releasing the mouse button or the modifier keyboard key
'''
Enable turntable rotation with any axis up, the axis that is most aligned vertically is the new up axis of the turntable rotation until a new mouse gesture is initiated by either releasing the mouse button or the modifier keyboard key
'''
bl_info = {
'name': 'Rotate Turntable ANY-axis Up',
'author': '',
'version': (0, 0, 1),
'blender': (2, 6, 7),
'location': '3d view > Ctrl + LMB-drag',
@rraallvv
rraallvv / space_view3d_turntable_z_up.py
Last active January 29, 2019 11:04
Blender Add-on to enable turntable rotation with the Z-axis up (Crtl+LeftMouseDrag)
'''
Enable turntable rotation with Z axis up. This addon allows you to have both rotations available, either the built-in trackball, or the turntable provided by the addon can be used at any time without the need to change the user preferences.
'''
bl_info = {
'name': 'Rotate Turntable Z-axis Up',
'author': '',
'version': (0, 0, 1),
'blender': (2, 6, 7),
'location': '3d view > Ctrl + LMB-drag',
@rraallvv
rraallvv / build-unit-php.txt
Created December 2, 2018 15:55
Build Unit-PHP on Ubuntu
$ sudo apt-get install build-essential
$ sudo apt-get install golang
$ curl -sL https://deb.nodesource.com/setup_<Node.js version>.x | bash -; apt-get install nodejs
$ sudo apt-get install php-dev libphp-embed
$ sudo apt-get install libperl-dev
$ sudo apt-get install python-dev
$ sudo apt-get install ruby-dev
$ sudo apt-get install libssl-dev
$ git clone https://github.com/nginx/unit