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
upower -i /org/freedesktop/UPower/devices/battery_BAT0 |
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
struct Base { | |
Base(int a) : i(a) {} | |
int i; | |
}; | |
struct Derived : Base { | |
Derived(int a, std::string s) : Base(a), m(s) {} | |
using Base::Base; // Inherit Base's constructors. | |
// Equivalent to: |
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
#Create a file called | |
/etc/udev/rules.d/70-persistent-net.rules | |
#Add this and replace address and name: | |
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="02:01:02:03:04:05", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="eth0" | |
#Modify the grub configuration | |
/etc/default/grub | |
# Replace this line | |
GRUB_CMDLINE_LINUX="" | |
# with |
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
#Rename multiple files: | |
rename 's/old-name/new-name/' files | |
#In file replacements: | |
sed -i 's/old-name/new-name/g' config.h.in |
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
/* | |
* Code for a Wemos D1 mini to offer a capacitive touch, show the status on the LED and also read the temperature. Can also be used with a ENC28J60 module as all required pins are still free. | |
*/ | |
////Temperature sensor | |
#include "DHT.h" | |
#define DHTPIN D3 //GPIO 0 | |
#define DHTTYPE DHT11 | |
#define INTERVAL_PUBLISHING 5000 | |
DHT dht(DHTPIN, DHTTYPE, 15); |
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
#include <boost/asio/io_service.hpp> | |
#include <boost/bind.hpp> | |
#include <boost/thread/thread.hpp> | |
#include <boost/make_shared.hpp> | |
#include <iostream> | |
class Bla{ | |
public: | |
void callback(std::string msg){ |
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
pdfunite in-1.pdf in-2.pdf in-n.pdf out.pdf |
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
cat ~/.ssh/id_rsa.pub | (ssh user@host "cat >> ~/.ssh/authorized_keys") |
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
#Error from /var/log/auth.log upon ssh login when ssh key is not accepted: | |
userauth_pubkey: key type ssh-dss not in PubkeyAcceptedKeyTypes [preauth] | |
sudo nano /etc/ssh/sshd_config | |
#add this line | |
PubkeyAcceptedKeyTypes=+ssh-dss | |
#save and close | |
#reload service | |
sudo service sshd reload |
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
# install | |
sudo apt-get update | |
sudo apt-get install dphys-swapfile | |
# config | |
sudo nano /etc/dphys-swapfile | |
# verify with | |
free |
NewerOlder