create a script file:
touch /tmp/oneshot_example
copy and paste the content from Run script
session then run chmod +x /tmp/oneshot_example
and sudo /tmp/oneshot_example
Raw example can be found here
create a script file:
touch /tmp/oneshot_example
copy and paste the content from Run script
session then run chmod +x /tmp/oneshot_example
and sudo /tmp/oneshot_example
Raw example can be found here
# Locate the Google C++ Mocking Framework. | |
# (This file is almost an identical copy of the original FindGTest.cmake file, | |
# feel free to use it as it is or modify it for your own needs.) | |
# | |
# | |
# Defines the following variables: | |
# | |
# GMOCK_FOUND - Found the Google Testing framework | |
# GMOCK_INCLUDE_DIRS - Include directories | |
# |
#!/bin/bash | |
sudo apt update | |
sudo apt install docker.io | |
sudo usermod -aG docker ${USER} | |
su - ${USER} | |
id -nG | |
docker version | |
docker run hello-world |
#!/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 |
#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 |
# Put inside /etc/udev/rules.d/ | |
udevadm info --attribute-walk /dev/video0 |
#include <assert.h> | |
#include <thread> | |
#include <mutex> | |
#include <future> | |
#include <iostream> | |
#include <deque> | |
int a = 0; | |
std::mutex mutex; |
#include <iomanip> | |
#include <chrono> | |
#include <ctime> | |
#include <iostream> | |
#include <string> | |
#include <fstream> | |
int main () | |
{ | |
auto now = std::chrono::system_clock::now(); |
# Bring LTE connection up | |
ifconfig wwan0 up | |
# Bring LTE connection down | |
ifconfig wwan0 down |
# <PID number> = 1234 | |
strace -p<PID number> -s9999 -e write |