Skip to content

Instantly share code, notes, and snippets.

//Copy/Export a Large Database
mysqldump -u [USERNAME] -p [DBNAME] | gzip > [/path_to_file/DBNAME].sql.gz
//Import a Large Database
//First, unzip the file.
//gzip -d [/path_to_file/DBNAME].sql.gz
mysql -u root -p
SHOW DATABASES;
CREATE DATABASE [DBNAME];
USE [DBNAME];
SOURCE [/path_to_file/DBNAME].sql;
@light9
light9 / new_gist_file
Created September 21, 2013 10:11
Debugging Nginx Configuration
nginx -t && service nginx reload
service nginx status # to poll for current status
service nginx stop # to stop any servers if any
service nginx start # to start the server
@light9
light9 / imageapibackground.patch
Created September 23, 2013 15:09
Configurable background color when cropping to larger dimensions
Index: imageapi_gd.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imageapi/imageapi_gd.module,v
retrieving revision 1.13.2.7
diff -u -r1.13.2.7 imageapi_gd.module
--- imageapi_gd.module 17 Apr 2009 00:15:21 -0000 1.13.2.7
+++ imageapi_gd.module 8 Oct 2009 21:05:23 -0000
@@ -27,6 +27,15 @@
'#default_value' => variable_get('imageapi_jpeg_quality', 75),
'#field_suffix' => '%',
@light9
light9 / new_gist_file
Created September 24, 2013 04:13
(づ。◕‿‿◕。)づ*:・゚✧*:・゚✧
(づ。◕‿‿◕。)づ*:・゚✧*:・゚✧
@light9
light9 / show active connections
Created October 1, 2013 16:20
show active connections
netstat -antp
ps aux | grep node
kill -9
@light9
light9 / Check whether packet is installed
Created October 1, 2013 17:59
Check whether ssh is installed in your system using dpkg tool.
dpkg -l | grep ssh
@light9
light9 / Check if daemon is running
Created October 1, 2013 18:13
Check ssh daemon is running in your server with ps command.
ps aux | grep sshd
@light9
light9 / check listening on port
Created October 1, 2013 18:14
Use netstat command to check that ssh is listening on port 22.
sudo netstat -nap | grep :22
@light9
light9 / derby new app
Created October 6, 2013 01:44
Создаем приложение, с названием hello-derby (это будет также название папки):
derby new hello-derby
cd hello-derby
npm start
@light9
light9 / new node app
Created October 6, 2013 02:46
new node js app
git clone..
cd ..
npm install
npm start