This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* On Key Bindings - Default/User */ | |
{ "keys": ["shift+alt+up"], "command": "select_lines", "args": {"forward": false} }, | |
{ "keys": ["shift+alt+down"], "command": "select_lines", "args": {"forward": true} } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# find $FOLDER -type $DOCUMENT_TYPE -name $ARG | |
find ~/ -type f -name "wally.txt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Before commit | |
git checkout -- $FILE_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# On the Maven project folder | |
# Compiling current mvn project and assembling it | |
# into a single .jar file. That way we can execute the | |
# project without running into 'class not found' errors. | |
# Ref: http://stackoverflow.com/a/574650/3147039 | |
mvn clean compile assembly:single | |
# Running java program (generated snapshot from Maven project) | |
java -jar target/App-0.0.1-SNAPSHOT-jar-with-dependencies.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SocketIO cheat sheet | |
// SocketIO is a library that makes websockets communications easier. | |
// Page: http://socket.io/ | |
// ref: http://stackoverflow.com/a/10099325 | |
// send to current request socket client | |
socket.emit('message', "this is a test"); | |
// sending to all clients, include sender | |
io.sockets.emit('message', "this is a test"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Killing task 'mysql-workbench' | |
kill $(ps -A | awk '/[m]ysql-workbench/ {print $1}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Looking for large files | |
sudo find / -type f -size +1G -exec ls -lh {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find -name "*.txt" -size -2k -delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tar stores relative paths by default. GNU tar even says so if you try to store an absolute path: | |
# Create .tar file (with gzip) | |
tar -zcvf foo.tar /home/foo | |
# Have a look at what's in the tar file: | |
tar -tvf foo.tar | |
# Extracting file from tar file | |
tar -xvf foo.tar home/foo/bar # Note: no leading slash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Author: Matheus Cesário <[email protected]> | |
# Description: Killing all slow queries from bd | |
# Example: sh kill_them_all.sh -s 100 | |
# Variables | |
SECONDS=0 # Seconds | |
USER="" # DB user | |
PASSWORD="" # DB password | |
HOST="" # DB host |
OlderNewer