Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
nc {IP} {port} | hexdump -e '16/1 "%0.2x " "\n" 1/1 "%0.2x " "\n"' |
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
Go to Bitbucket and create a new repository (its better to have an empty repo) | |
git clone [email protected]:abc/myforkedrepo.git | |
cd myforkedrepo | |
Now add Github repo as a new remote in Bitbucket called "sync" | |
git remote add sync [email protected]:def/originalrepo.git | |
Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync" | |
git remote -v |
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
curl http://opentsdb.servicelocal:4242/api/stats | jq '.[] | select(.metric == "tsd.rpc.received")' |
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
some_cmd > some_file 2>&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
#Requirements: | |
# aws cli | |
# jq | |
aws logs get-log-events --log-group-name LOGGROUP --log-stream-name STREAMID \ | |
--limit 100 | jq '.events | .[] | .message' | \ | |
awk '{printf "%s:%s\t->\t%s:%s\n", $4, $6, $5, $7}' |
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
/* | |
The server extends QTcpServer | |
*/ | |
SocketServer::SocketServer(QObject *parent) : QTcpServer(parent) | |
{ | |
} | |
//Method to start listening for connections in a given port and range of remote addresses: | |
//QHostAddress::LocalHost only accepts connections from localhost | |
//QHostAddress::Any accepts connections from anywhere. |
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
/* | |
Connecting to a TCP socket server. | |
*/ | |
//Create the socket object. | |
QTcpSocket *socket = new QTcpSocket(this); | |
//tap into the socket signals with some local methods. | |
//status signals | |
connect(socket, SIGNAL(connected()), this, SLOT(connected())); |
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
/* | |
This code redirects the output of qDebug() to a log file. | |
It also rotates the file base on size. | |
Uses QMutex for thread safety. | |
*/ | |
//some constants to parameterize. | |
const qint64 LOG_FILE_LIMIT = 3000000; | |
const QString LOG_PATH = "/application/logs/"; | |
const QString LOG_FILENAME = "mylogfile.log"; |
NewerOlder