A Pen by Daniel Sixl on CodePen.
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 <atomic> | |
int main(){ | |
std::atomic<int> a(23); | |
int b = 23; | |
std::cout << a << std::endl; | |
a.compare_exchange_weak(b, 12); | |
std::cout << a << std::endl; | |
return 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
//Based on https://github.com/cnlohr/lamenet/blob/master/librawp.c | |
#include <stdio.h> | |
#include <arpa/inet.h> | |
#include <string.h> | |
#include <linux/if_packet.h> | |
#include <sys/ioctl.h> | |
#include <sys/socket.h> | |
#include <net/if.h> | |
#include <netinet/ether.h> |
Using xclip to copy terminal content to the clip board:
Say you want to pipe shell output to your clipboard on Linux. How would you do it? First, choose the clipboard destination, either the Mouse clip or the system clipboard.
For the mouse clipboard, pipe straight to xclip:
echo 123 | xclip
For the system clip board, pipe to xclip and select clip directly: