Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
d̷o̷n̷'̷t̷ ̷e̷v̷e̷n̷ ̷t̷r̷y̷ ̷t̷o̷ ̷b̷o̷t̷h̷e̷r̷ ̷m̷e̷

Svetlana Linuxenko linuxenko

💭
d̷o̷n̷'̷t̷ ̷e̷v̷e̷n̷ ̷t̷r̷y̷ ̷t̷o̷ ̷b̷o̷t̷h̷e̷r̷ ̷m̷e̷
  • ⓡⓐⓖⓤⓛⓐⓝⓓ
View GitHub Profile
View shiftout.c
void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val)
{
uint8_t i;
for (i = 0; i < 8; i++) {
if (bitOrder == LSBFIRST)
digitalWrite(dataPin, !!(val & (1 << i)));
else
digitalWrite(dataPin, !!(val & (1 << (7 - i))));
View fcgi-fpm.conf
<IfModule mod_fastcgi.c>
AddHandler php5-fcgi .php
Action php5-fcgi /php5-fcgi
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization
<Directory /usr/lib/cgi-bin>
Require all granted
</Directory>
View console.save
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data')
return;
}
if(!filename) filename = 'console.json'
View conky run
In your conky config, add:
own_window yes
own_window_class Conky
own_window_type override
This line keeps conky from getting controlled by the wm:
own_window_type override
View hosts.txt
# AdAway default blocklist
# Blocking mobile ad providers and some analytics providers
#
# Contribute:
# Create an issue at https://github.com/AdAway/AdAway/issues
#
# Changelog:
# 2016-07-18 Now hosted on GitHub + Cloudflare
# 2014-05-18 Now with a valid SSL certificate available at https://adaway.org/hosts.txt
# 2013-03-29 Integrated some hosts from
View groupbasedroute.txt
# add group (to be used for iptables matching)
groupadd novpn
# add user to group
adduser yourusername novpn
# set iptables rules (marking packets of novpn group)
iptables -t mangle -A OUTPUT -m owner --gid-owner novpn -j MARK --set-mark 1
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
@linuxenko
linuxenko / client.conf
Created Nov 20, 2017
vkontakte openvpn rules
View client.conf
## vk
route 95.213.0.0 255.255.192.0
route 95.142.207.0 255.255.255.0
route 95.142.206.0 255.255.255.0
route 95.142.204.0 255.255.248.0
route 95.142.203.0 255.255.255.0
route 95.142.202.0 255.255.255.0
route 95.142.201.0 255.255.255.0
route 95.142.192.0 255.255.248.0
View 195.82.146 rules.txt
route-nopull
route 195.82.146.30 255.255.255.255
route 195.82.146.52 255.255.255.255
route 195.82.146.216 255.255.255.255
route 195.82.146.215 255.255.255.255
route 195.82.146.214 255.255.255.255
View cidr2mask
cidr2mask() {
local i mask=""
local full_octets=$(($1/8))
local partial_octet=$(($1%8))
for ((i=0;i<4;i+=1)); do
if [ $i -lt $full_octets ]; then
mask+=255
elif [ $i -eq $full_octets ]; then
mask+=$((256 - 2**(8-$partial_octet)))