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
#ifdef SHELL | |
gcc -Wall -Werror $0 && ./a.out | |
exit $? | |
#endif | |
#include <stdio.h> | |
void change_oom_score(int oom_adj) { | |
FILE * fp = fopen("/proc/self/oom_adj", "w"); // Old one (SK20) | |
if ( ! fp ) fp = fopen("/proc/self/oom_score_adj", "w"); // New one |
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
#ifdef SHELL | |
gcc -Wall -Werror $0 && ./a.out | |
exit $? | |
#endif | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <stdlib.h> |
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 | |
# To put in /etc/cron.daily | |
date=$(date +%Y-%m-%d) | |
cd /var/lib/cassandra/data | |
for dir in $(find -mindepth 2 -maxdepth 2 -type d) | |
do | |
count=$(ls $dir/*-Data.db 2>/dev/null | wc -l) | |
echo ${date}: ${count} >>$dir/sstables_count | |
done |
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
INFO [AntiEntropyStage:6] 2014-09-28 22:27:45,482 RepairSession.java:171 - [repair #e4bf3e70-474d-11e4-a221-2fe2626539ec] Received merkle tree for domain from /172.16.66.81 | |
ERROR [RepairJobTask:1] 2014-09-28 22:27:45,484 RepairJob.java:127 - Error occurred during snapshot phase | |
java.lang.RuntimeException: Could not create snapshot at /172.16.66.81 | |
at org.apache.cassandra.repair.SnapshotTask$SnapshotCallback.onFailure(SnapshotTask.java:77) ~[apache-cassandra-2.1.0.jar:2.1.0] | |
at org.apache.cassandra.net.ResponseVerbHandler.doVerb(ResponseVerbHandler.java:48) ~[apache-cassandra-2.1.0.jar:2.1.0] | |
at org.apache.cassandra.net.MessageDeliveryTask.run(MessageDeliveryTask.java:62) ~[apache-cassandra-2.1.0.jar:2.1.0] | |
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_67] | |
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_67] | |
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_67] | |
ERROR [AntiEntropyStage:6] 2014-09-28 22:27:45,484 C |
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
INFO [AntiEntropyStage:227] 2014-09-28 15:00:41,982 RepairSession.java:171 - [repair #1d30ffe0-474a-11e4-84bd-79f3bc6874b0] Received merkle tree for registrynodedata from /172.16.66.81 | |
ERROR [AntiEntropyStage:227] 2014-09-28 15:00:41,982 CassandraDaemon.java:166 - Exception in thread Thread[AntiEntropyStage:227,5,main] | |
java.lang.ClassCastException: null | |
ERROR [RepairJobTask:3] 2014-09-28 15:00:41,983 RepairJob.java:127 - Error occurred during snapshot phase | |
java.lang.RuntimeException: Could not create snapshot at /172.16.66.81 | |
at org.apache.cassandra.repair.SnapshotTask$SnapshotCallback.onFailure(SnapshotTask.java:77) ~[apache-cassandra-2.1.0.jar:2.1.0] | |
at org.apache.cassandra.net.ResponseVerbHandler.doVerb(ResponseVerbHandler.java:48) ~[apache-cassandra-2.1.0.jar:2.1.0] | |
at org.apache.cassandra.net.MessageDeliveryTask.run(MessageDeliveryTask.java:62) ~[apache-cassandra-2.1.0.jar:2.1.0] | |
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_20] | |
at java.util.concurren |
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
#ifdef SHELL | |
gcc -Wall -Werror $0 && ./a.out | |
exit $? | |
#endif | |
#include <stdio.h> | |
#include <stdbool.h> | |
#include <limits.h> | |
#define DIJ_MAX_PATHS 10 |
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
#ifdef SHELL | |
gcc -Wall -Werror $0 && ./a.out | |
exit $? | |
#endif | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdbool.h> | |
#define max(a,b) \ |
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/bash | |
# The binary is most likely to have the current directory name | |
PROCESS=${PWD##*/} | |
# We kill the previous process | |
killall ${PROCESS} | |
# We launch the process | |
go build |
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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"io" | |
"log" | |
"net" | |
"os" | |
"runtime" |
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
#!/usr/bin/python | |
import urllib | |
import requests | |
import re | |
import sqlite3 | |
import os | |
import argparse | |
import gettext | |
import logging | |
import logging.handlers |