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
| // stack_trace.c | |
| // | |
| // gcc stack_trace.c -ldw -lunwind -g -o stack_trace | |
| #define UNW_LOCAL_ONLY | |
| #include <elfutils/libdwfl.h> | |
| #include <libunwind.h> | |
| #include <stdio.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
| #ifdef SHELL | |
| gcc -ansi -g $0 && ./a.out | |
| exit 0 | |
| #endif | |
| #include <stdio.h> | |
| #include <string.h> | |
| void permutation (char * prefix, char * str) { | |
| int n = strlen(str); |
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
| #ifdef SHELL | |
| gcc -std=c99 -Wall -Werror $0 && ./a.out | |
| exit $? | |
| #endif | |
| #include <stdio.h> | |
| /* | |
| Output: |
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
| #ifdef SHELL | |
| gcc -Wall -Werror $0 && ./a.out | |
| exit $? | |
| #endif | |
| /* | |
| Output: | |
| Table : 0x7fff03ab7490 | |
| Row 0 : 0x7fff03ab7490 | |
| Cell 0:0 : 0x7fff03ab7490 |
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
| #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 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
| #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 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
| #!/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 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
| 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 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
| 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 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
| #ifdef SHELL | |
| gcc -Wall -Werror $0 && ./a.out | |
| exit $? | |
| #endif | |
| #include <stdio.h> | |
| #include <stdbool.h> | |
| #include <limits.h> | |
| #define DIJ_MAX_PATHS 10 |