Skip to content

Instantly share code, notes, and snippets.

Avatar

ikosuave vanjos

View GitHub Profile
@vanjos
vanjos / NC-MySQLDUMP.sh
Last active Aug 2, 2022
Easy way to do a mysqldump and restore using netcat (this is NOT encrypted)
View NC-MySQLDUMP.sh
#####
# You'll be needing two machines, the target machine and source one (makes sense, right)?
#####
# On the target machine
nc -l 55555 | gzip -d -c | mysql <database name> -u<user> -p<password> [ | <decrypt> ]
#####
# On the source machine
mysqldump -u<user> -p<password> <database name> | gzip | nc <ip of target server> 55555 [ | <encrypt> ]
@vanjos
vanjos / datastax_cassandra.sh
Last active Apr 4, 2017
Very quick and easy Cassandra (1.2) Installation on an EC2 (or really any) Ubuntu offering.
View datastax_cassandra.sh
#!/bin/bash
###
#
# Find out which ami to use on http://www.alestic.com
#
# at the time of this writing, Ubuntu 12.04 (Precise) was ami-23d9a94a
# with EBS boot
#
# In order for this to work, tuned your firewall for the following:
@vanjos
vanjos / bpnn.py
Created Feb 4, 2013
Backward Propagation Neural Network (XOR)
View bpnn.py
#!/usr/bin/env python
import math
import random
import string
random.seed(0)
# calculate a random number where: a <= rand < b
@vanjos
vanjos / innodb_memcheck.sql
Created Jan 31, 2013
Find out how much possible MEM MySQL would use (with INNODB)
View innodb_memcheck.sql
SHOW VARIABLES LIKE 'innodb_buffer_pool_size';
SHOW VARIABLES LIKE 'innodb_additional_mem_pool_size';
SHOW VARIABLES LIKE 'innodb_log_buffer_size';
SHOW VARIABLES LIKE 'thread_stack';
SET @kilo_bytes = 1024;
SET @mega_bytes = @kilo_bytes * 1024;
SET @giga_bytes = @mega_bytes * 1024;
SET @innodb_buffer_pool_size = 2 * @giga_bytes;
SET @innodb_additional_mem_pool_size = 16 * @mega_bytes;
SET @innodb_log_buffer_size = 8 * @mega_bytes;