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
#!/bin/bash | |
# Generate Gree heat pump IR codes, according to | |
# https://forum.mysensors.org/uploads/files/1469565493670-gree.pdf | |
# How to use raw codes in LIRC see e.g. | |
# https://github.com/suikammd/AirConditioner-Homekit/ | |
MSG_SPACE=20000 | |
HDR_MARK=9000 | |
HDR_SPACE=4500 |
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 <sys/vfs.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
int main (int argc, char **argv) { | |
if (argc < 2) exit(EXIT_FAILURE); | |
struct statfs info; | |
if (statfs(argv[1], &info) == 0) { | |
printf("%s - block size: %ld," | |
" total data blocks: %ld," |
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
#!/bin/sh | |
# Ubuntu: | |
# sudo apt-get install xdotool | |
while [ "$((i+=1))" != 100 ]; do | |
sleep 120 | |
xdotool key F5 | |
sleep 60 | |
scrot |
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
# To reduce eMMC wear remap write-intensive directories to memory fs | |
# Mount /tmp into tmpfs | |
sudo echo "tmpfs /tmp tmpfs defaults 0 0" >> /etc/fstab | |
sudo rm -rf /var/tmp && ln -s /tmp /var/tmp | |
# Mount /var/log into tmpfs | |
sudo cat > /etc/init/mount-log.conf <<EOT |
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
-- HTTP redirect daemon | |
local port = 80 | |
local redir = "HTTP/1.0 301 Moved Permanently\nLocation: https://example.org/\n\n" | |
local socket = require("socket") | |
local daemon = require("daemon") | |
daemon.daemonize() | |
local server = assert(socket.bind("*", port)) |
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
#!/bin/sh /etc/rc.common | |
# Copy this skript to /etc/init.d/adblock and enable: | |
# chmod +x /etc/init.d/adblock | |
# /etc/init.d/adblock enable | |
START=90 | |
ADS='http://pgl.yoyo.org/as/serverlist.php?hostformat=dnsmasq&showintro=0&mimetype=plaintext' |
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
#!/bin/sh | |
# Hotlug2 script which starts minidlna when USB disk gets attached | |
# [email protected] | |
# Sharing: GPLv3 or later | |
# To handle minidlna startup through hotplug you should disable minidlna autostart | |
# /etc/init.d/minidlna disable | |
# and copy current script to /etc/hotplug.d/block/30-minidlna |
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
#!/bin/sh | |
# Configure OpenWrt NAS | |
# Attached USB drive is accessible through | |
# 1. http://nasbox/A | |
# 2. CIFS - //nasbox/A | |
# 3. DLNA | |
# where "nasbox" is your router name and "A" represents one of the mountpoints below |
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
# Show .s and .S asm sources in file open dialog | |
source.files=*.asm;*.c;*.cc;*.cpp;*.cxx;*.cs;*.h;*.hh;*.hxx;*.hpp;\ | |
*.rc;*.rc2;*.def;*.java;*.js;*.py;*.pl;*.rb;*.cgi;*.lua;*.conf;\ | |
Make*;make*;*.mak;*.properties;*.html;*.xml;*.iface;*.bat;\ | |
*.s;*.S;*.dump;*.haml | |
# GNU asm file | |
file.patterns.gasm=*.s;*.S;*.dump | |
filter.gasm=GNU Assembler (asm)|$(file.patterns.gasm)| | |
lexer.$(file.patterns.gasm)=asm |
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
# | |
# Makefile for msp430 | |
# | |
# 'make' builds everything | |
# 'make lst' generates assembly listings of each source | |
# 'make dump' generates assembler dump of target | |
# 'make burn' flashes target into launchpad | |
# 'make clean' deletes everything except source files and Makefile | |
# | |
# You need to set TARGET, MCU and SOURCES for your project. |
NewerOlder