This file contains hidden or 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
/** | |
@file producer_consumer.c | |
@info A sample program to demonstrate the classic consumer/producer problem | |
using pthreads. | |
*/ | |
#include <stdio.h> | |
#include <pthread.h> |
This file contains hidden or 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
/** | |
Get server version. | |
*/ | |
import java.sql.*; | |
import java.sql.DatabaseMetaData; | |
import java.sql.ResultSet; | |
import java.sql.DriverManager; | |
import java.sql.SQLException; | |
import java.util.*; |
This file contains hidden or 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
#define compile_time_assert(expr) \ | |
do \ | |
{ \ | |
typedef char compile_time_assert[(expr) ? 1 : -1] __attribute__((unused)); \ | |
} while(0) |
This file contains hidden or 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
package main | |
import "fmt" | |
type myColor string | |
const ( | |
RED myColor = "red" | |
GREEN myColor = "green" | |
BLUE myColor = "blue" |
This file contains hidden or 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
50217 15:49:02 [Note] WSREP: (dc9e817d-b6e5-11e4-a36f-8fe330cf395b, 'tcp://0.0.0.0:4010') turning message relay requesting on, nonlive peers: tcp://192.168.0.8:4030 tcp://192.168.0.8:4040 | |
150217 15:49:03 [Note] WSREP: (dc9e817d-b6e5-11e4-a36f-8fe330cf395b, 'tcp://0.0.0.0:4010') reconnecting to 370a81b6-b6e6-11e4-b985-beb180620fd9 (tcp://192.168.0.8:4030), attempt 0 | |
150217 15:49:03 [Note] WSREP: (dc9e817d-b6e5-11e4-a36f-8fe330cf395b, 'tcp://0.0.0.0:4010') reconnecting to 4ba33092-b6e6-11e4-93a4-ba232dff3484 (tcp://192.168.0.8:4040), attempt 0 | |
150217 15:49:04 [Note] WSREP: evs::proto(dc9e817d-b6e5-11e4-a36f-8fe330cf395b, GATHER, view_id(REG,370a81b6-b6e6-11e4-b985-beb180620fd9,4)) suspecting node: 370a81b6-b6e6-11e4-b985-beb180620fd9 | |
150217 15:49:04 [Note] WSREP: evs::proto(dc9e817d-b6e5-11e4-a36f-8fe330cf395b, GATHER, view_id(REG,370a81b6-b6e6-11e4-b985-beb180620fd9,4)) suspecting node: 4ba33092-b6e6-11e4-93a4-ba232dff3484 | |
... | |
... | |
150217 15:49:14 [Note] WSREP: evs::proto(dc9e817d-b6e5-11e4-a36f-8fe330cf395b, G |
This file contains hidden or 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
$ echo "nirbhay" | cracklib-check | |
nirbhay: it is based on your username | |
$ echo "password" | cracklib-check | |
password: it is based on a dictionary word | |
$ echo "qwerty" | cracklib-check | |
qwerty: it is based on a dictionary word | |
$ echo "123" | cracklib-check | |
123: it is WAY too short | |
$ echo "123456" | cracklib-check | |
123456: it is too simplistic/systematic |
This file contains hidden or 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
MariaDB [test]> INSTALL SONAME 'cracklib_password_check'; | |
Query OK, 0 rows affected (0.05 sec) | |
MariaDB [test]> SELECT VARIABLE_NAME, DEFAULT_VALUE, VARIABLE_COMMENT FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'CRACKLIB_PASSWORD%'\G | |
*************************** 1. row *************************** | |
VARIABLE_NAME: CRACKLIB_PASSWORD_CHECK_DICTIONARY | |
DEFAULT_VALUE: /var/cache/cracklib/cracklib_dict | |
VARIABLE_COMMENT: Path to a cracklib dictionary | |
1 row in set (0.00 sec) |
This file contains hidden or 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
MariaDB [test]> INSTALL SONAME 'simple_password_check'; | |
Query OK, 0 rows affected (0.04 sec) | |
MariaDB [test]> SELECT VARIABLE_NAME, DEFAULT_VALUE, VARIABLE_COMMENT FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'SIMPLE_PASSWORD%'\G | |
*************************** 1. row *************************** | |
VARIABLE_NAME: SIMPLE_PASSWORD_CHECK_DIGITS | |
DEFAULT_VALUE: 1 | |
VARIABLE_COMMENT: Minimal required number of digits | |
*************************** 2. row *************************** | |
VARIABLE_NAME: SIMPLE_PASSWORD_CHECK_LETTERS_SAME_CASE |
This file contains hidden or 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
$sudo ngrep -x -q -d lo port 16001 | |
# where, | |
# -x : Dump packet contents as hexadecimal | |
# -q : Be quiet, do not print '#' for every packet received | |
# -d <dev> : Listen to 'dev' interface only | |
# port <port> : Print packets with this source or destination port only | |
interface: lo (127.0.0.0/255.0.0.0) | |
filter: (ip or ip6) and ( port 16001 ) |
This file contains hidden or 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
/* | |
@File : largest_event.go | |
@Description : Find the largest event in a binary log file. | |
@Usage : ./largest_event.go -file=<binary log file> | |
*/ | |
package main | |
import ( | |
"flag" |