Skip to content

Instantly share code, notes, and snippets.

View thunder-spb's full-sized avatar
:octocat:
Stressing things

Alexzander thunder Shevchenko thunder-spb

:octocat:
Stressing things
View GitHub Profile
@thunder-spb
thunder-spb / sql.go
Created June 10, 2021 10:09 — forked from Indribell/sql.go
Extension for sql package
// Fixing some of the errors in the:
// https://gist.github.com/PumpkinSeed/b4993c6ad20ea90e3da8c991a90a91e1
//
// 1. It was only able to extract database information, based upon a Struct.
// The code now can deal with a struct or a slice with structs.
//
// 2. The code relied on the json tag in the struct.
// You need to match the data with database fields, not the output fields.
// This will match up more 1 to 1 as you are in controle of your Database naming and selecting of that data.
// If a client expect different named exported json fields, ...
@thunder-spb
thunder-spb / profiles.json
Created May 30, 2020 11:13 — forked from kasuken/profiles.json
Windows Terminal settings and files
{
"globals" :
{
"alwaysShowTabs" : true,
"defaultProfile" : "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"initialCols" : 120,
"initialRows" : 30,
"keybindings" :
[
{
@thunder-spb
thunder-spb / rotmg-wexpander-userscripts.js
Created January 12, 2018 16:53
RotMG window expander (just to save it here)
// ==UserScript==
// @name Realm of the Mad God flash window expander
// @namespace http://thunders.spb.ru/user-scripts/src/rotmg-userscript.js
// @version 0.2.3
// @description Resize flash window to 1280x1024, 1024x768, 800x600, 640x480. Added Buttons to change Size dynamically =) Saves settings to Cookies.
// @include http://www.realmofthemadgod.com/*
// @source http://thunders.spb.ru/user-scripts/rotmg/
// @require http://jquery.com/src/jquery-latest.min.js
// @copyright 2012+, thunder (ingame thunderspb @ EUNorth Server)
// @author thunder, thunder@blackdeath.ru
@thunder-spb
thunder-spb / aws_ec2_wait.sh
Created November 29, 2017 12:19 — forked from sgnn7/aws_ec2_wait.sh
Wait for AWS EC2 snapshot or volume for longer than 20 mins
#!/bin/bash -e
EC2_REGION="us-west-1"
DEFAULT_PROGRESS_WAIT=5
# ========== SNAPSHOT WAIT ==============
snapshot_id="snap-testtesttest"
while [ "$snapshot_progress" != "100%" ]; do
sleep "$DEFAULT_PROGRESS_WAIT"
#!/usr/bin/env python
#
# Copyright (C) 2015 Alexander Taler
#
# This 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 3 of the License, or
# (at your option) any later version.
#
# This is distributed in the hope that it will be useful,
@thunder-spb
thunder-spb / deploy.yaml
Created February 2, 2016 15:58 — forked from mblarsen/deploy.yaml
Solution for `git clone` using Ansible for repos with private submodules with github deploy keys
# Problem:
#
# If you use git submodules linking two private github repos, you'll need to create a separate deploy key for each.
# Multiple keys are not supported by Ansible, nor does ansible (when running git module) resort to your `.ssh/config` file.
# This means your ansible playbook will hang in this case.
#
# You can however use the ansible git module to checkout your repo in multiple steps, like this:
#
- hosts: webserver
vars:
@thunder-spb
thunder-spb / Ambilight test videos
Last active August 31, 2018 00:05
DIY Abmilight like system
Philips official:
https://www.youtube.com/watch?v=jV8IFZ5Sa_k
https://www.youtube.com/watch?v=2x3psK5pjME
20min demo video:
https://dl.dropboxusercontent.com/u/12487373/Dreambox/AtmoLight_Demo_All_In_One_HD.zip
@thunder-spb
thunder-spb / gist:410663181f2268deb0ac
Created November 6, 2015 13:46 — forked from fernandoaleman/gist:5083680
How to update VirtualBox Guest Additions with vagrant
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
@thunder-spb
thunder-spb / gunicorn_start
Created September 3, 2015 11:06
Gunicorn for starting django apps
#!/bin/bash
NAME="app_newretail" # Name of the application
DJANGODIR=/data/webapps/python/newretail/${NAME} # Django project directory
SOCKFILE=/data/webapps/python/newretail/run/gunicorn.sock # we will communicte using this unix socket
USER=py_webapps # the user to run as
GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=${NAME}.settings # which settings file should Django use
DJANGO_WSGI_MODULE=${NAME}.wsgi # WSGI module name
@thunder-spb
thunder-spb / generator.php
Last active August 29, 2015 14:27 — forked from tawfekov/generator.php
Doctrine2 Generate Entities form Existing Database
<?php
include '../vendor/autoload.php';
$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
$classLoader->register();
// config
$config = new \Doctrine\ORM\Configuration();