Skip to content

Instantly share code, notes, and snippets.

View anytizer's full-sized avatar

Bimal Poudel anytizer

View GitHub Profile
@anytizer
anytizer / mysql admin.sql
Created September 8, 2014 07:33
Useful mysql admin functions
SHOW STATUS;
SHOW PROCESSLIST;
SHOW FULL PROCESSLIST;
KILL PROCESS 6607;
FLUSH LOGS;
FLUSH PRIVILEGES;
FLUSH HOSTS;
FLUSH TABLES;
FLUSH STATUS;
@anytizer
anytizer / newsletter pricing.txt
Created August 4, 2014 12:41
Cost of mass emailing
Mail Chimp
http://mailchimp.com/pricing/
http://mailchimp.com/pricing/growing-business/
iContact
http://www.icontact.com/pricing/
Aweber
@anytizer
anytizer / environment.htaccess
Created August 3, 2014 13:21
Setting up environment variables in .htaccess
# http://stackoverflow.com/questions/17581102/setting-environment-variable-using-htaccess
# print_r($_SERVER);
# Sets anything
SetEnv SERVER_KEY "qwerty"
SetEnv ANY_NAME "Dummy Name"
# Overwrites
SetEnv PATH "/"
@anytizer
anytizer / typical-mysqld.sh
Created August 3, 2014 07:48
The typical mysqld production server configurations
root@server [/tmp]# mysqld --print-defaults
mysqld would have been started with the following arguments:
--innodb_file_per_table=1 --tmp_table_size=128M --max_heap_table_size=128M --query_cache_size=64M --thread_cache_size=64 --key_buffer_size=32M --max_allowed_packet=16M --table_cache=1024 --table_definition_cache=8192 --innodb_buffer_pool_size=128M --innodb_flush_method=O_DIRECT --open_files_limit=16384 --max_connections=100 --max_user_connections=25 --wait_timeout=20 --myisam_sort_buffer_size=2M --thread_concurrency=4 --slow_query_log=1 --log-output=TABLE --long_query_time=20
@anytizer
anytizer / drop-backup-tables.sql
Created August 3, 2014 07:40
Drop backup tables (that started with an underscore _).
SELECT CONCAT('DROP TABLE `', TABLE_NAME, '`;') DROP_QUERY FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME LIKE '\_%';
# Connects to XAMPP's cdcol database
CREATE SERVER server1
FOREIGN DATA WRAPPER mysql
OPTIONS (USER 'root', PASSWORD 'toor', HOST 'localhost', PORT 3306, DATABASE 'cdcol');
USE test;
CREATE TABLE `cds` (
`titel` VARCHAR(200) DEFAULT '' NOT NULL,
`interpret` VARCHAR(200) DEFAULT '' NOT NULL,
@anytizer
anytizer / trimmer.php
Created July 30, 2014 12:55
Trim php.ini file and make it slim.
<?php
header('Content-Type: text/plain');
# Trims .ini files
$lines = file('C:/xampp/php/php.ini', FILE_IGNORE_NEW_LINES);
$trimmed = array();
foreach($lines as $l => $line)
{
if(!preg_match('/^[;|#]/', $line))
@anytizer
anytizer / qr code generators.txt
Created July 30, 2014 05:43
List of online QR Code Generators
http://qrdroid.com/generate/
https://chrome.google.com/webstore/detail/the-qr-code-generator/s
http://www.waspbarcode.com/qr-code-generator
http://www.visualead.com/qurify2/
http://www.visualead.com/qr-code-generator/
http://delivr.com/qr-code-generator
https://scan.me/qr-code-generator
http://qrcode.littleidiot.be/
http://www.qrcode-monkey.com/
https://www.unitag.io/qrcode
@anytizer
anytizer / federated.sql
Created July 29, 2014 07:30
Federated MySQL data
http://dev.mysql.com/doc/refman/5.0/en/federated-use.html
CREATE TABLE `T1`(`A` VARCHAR(100),UNIQUE KEY(`A`(30)))
ENGINE=FEDERATED
CONNECTION='MYSQL://127.0.0.1:3306/TEST/T1';
CREATE TABLE test_table (
id INT(20) NOT NULL AUTO_INCREMENT,
@anytizer
anytizer / chmod.txt
Created July 29, 2014 07:03
MySQL General log mode (Partial list in my.ini under #mysqld section)
[my.ini#mysql]
log-output=FILE
slow_query_log = 1
slow_query_log_file = /data/slow.log
general_log = 1
general_log_file = /data/sql.log