Skip to content

Instantly share code, notes, and snippets.

View proxium's full-sized avatar
🍒
Picking some sweet cherries

Rateb BEN MOUSSA proxium

🍒
Picking some sweet cherries
View GitHub Profile
# You should enable xDebug remotely then create the Tunnel
ssh -R <remote xDebug port>:127.0.0.1:<local xDebug configured port> username@remote_host -N -v -v
# * sudo netstat -lptu|grep -i <local xDebug configured port>
# Example output:
tcp 0 0 *:9001 *:* LISTEN 11902/java
# search recursively showing filename and line
grep -Hrn --exclude-dir=.git 'search term' path/to/files
# with support color
grep -Hrn search . | less -r
# Use those commands to check for duplicate lines in <file>
# The more verbose --count flag with the GNU version:
sort <file> | uniq -c
# The more verbose --count flag with the GNU version:
sort <file> | uniq --count
# Show only print duplicate lines
sort <file> | uniq -d
Verifying I am +ratebbenmoussa on my passcard. https://onename.com/ratebbenmoussa
@proxium
proxium / Drop-all-tables-in-database
Last active August 29, 2015 14:25
Shell command to do the drop (of all tables) in one shot
# Drop all tables from YOUR_DBSCHEMA_NAME
mysql --user=YOUR_USERNAME --password=YOUR_PASSWORD -BNe "show tables" YOUR_DBSCHEMA_NAME | tr '\n' ',' | sed -e 's/,$//' | awk '{print "SET FOREIGN_KEY_CHECKS = 0;DROP TABLE IF EXISTS " $1 ";SET FOREIGN_KEY_CHECKS = 1;"}' | mysql --user=YOUR_USERNAME --password=YOUR_PASSWORD YOUR_DBSCHEMA_NAME