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
#include <iostream> | |
#include <syslog.h> | |
#include <string> | |
#include <csignal> | |
void signal_handler(int signal_num) | |
{ | |
std::cout << "The interrupt signal is (" << signal_num << "). \n"; | |
// terminate program |
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
udevadm info --attribute-walk /dev/ttyUSB0 |
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
tmux new-session \; split-window -v -p 50 \; split-window -h -p 50 \; select-pane -t 0 \; split-window -h -p 50 \; |
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
# <PID number> = 1234 | |
strace -p<PID number> -s9999 -e write |
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
# Bring LTE connection up | |
ifconfig wwan0 up | |
# Bring LTE connection down | |
ifconfig wwan0 down |
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
#include <iomanip> | |
#include <chrono> | |
#include <ctime> | |
#include <iostream> | |
#include <string> | |
#include <fstream> | |
int main () | |
{ | |
auto now = std::chrono::system_clock::now(); |
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
#include <assert.h> | |
#include <thread> | |
#include <mutex> | |
#include <future> | |
#include <iostream> | |
#include <deque> | |
int a = 0; | |
std::mutex mutex; |
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
# Put inside /etc/udev/rules.d/ | |
udevadm info --attribute-walk /dev/video0 |
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
#include <iostream> | |
#include <chrono> | |
#include <unistd.h> | |
using namespace std; | |
// main function to measure elapsed time of a C++ program | |
// using chrono library | |
int main() | |
{ | |
auto start = chrono::steady_clock::now(); | |
// do some stuff here |
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/bash | |
ping www.google.fr | while read pong; do echo "$(date +%F%T): $pong"; done | |
# This command would show the output in /tmp/ping.log | To check the values during runtime one could run `tail -f /tmp/ping.log` | |
ping www.google.fr | while read pong; do echo "$(date +%F%T): $pong"; done > /tmp/ping.log |
OlderNewer