gitflow | git |
---|---|
git flow init |
git init |
git commit --allow-empty -m "Initial commit" |
|
git checkout -b develop master |
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
Following is a simple fail2ban jail for Mosquitto authentication. | |
When an authentication attempt fails, Mosquitto writes three lines like these to his log file: | |
--- | |
<TIMESTAMP>: New connection from <HOST> on port <PORT>. | |
<TIMESTAMP>: Sending CONNACK to <HOST> | |
<TIMESTAMP>: Socket error on client <unknown>, disconnecting. | |
--- | |
This filter looks for these three lines to get the host and allow you to ban it. |
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
project ( lua C ) | |
cmake_minimum_required ( VERSION 2.8 ) | |
include_directories ( src ${CMAKE_CURRENT_BINARY_DIR} ) | |
set ( SRC_CORE src/lapi.c src/lcode.c src/ldebug.c src/ldo.c src/ldump.c src/lfunc.c src/lgc.c src/llex.c | |
src/lmem.c src/lobject.c src/lopcodes.c src/lparser.c src/lstate.c src/lstring.c src/ltable.c | |
src/ltm.c src/lundump.c src/lvm.c src/lzio.c ) | |
set ( SRC_LIB src/lauxlib.c src/lbaselib.c src/ldblib.c src/liolib.c | |
src/lmathlib.c src/loslib.c src/lstrlib.c src/ltablib.c src/loadlib.c src/linit.c ) |
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
#!/usr/bin/env python | |
timerBusClkFreq=216000000 | |
timerDesiredIntFreq=5000 | |
#counts=43200 | |
counts=timerBusClkFreq/timerDesiredIntFreq | |
prescaler=0 | |
period=0 | |
#counts = (prescaler + 1)*(period + 1) |
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 | |
source ${HOME}/.bashrc_rogers | |
LOGFILE_NAME=whatismyip.log | |
GATEWAY_IP=192.168.0.1 | |
IP_PAGE_URL=checkip.dyndns.org | |
LAST_IP=`whatismyip` | |
echo "Initial IP: ${LAST_IP}" |
It's a script (think of it as mod) for plug.dj which will allow you to add YT (YouTube) videos to your playlists with one button.
Plug.dj is having some trouble with their YT API Key (the thing that allows you to make YT related actions throughout the site, like searching for a song and adding the results to your playlists). Using this script, you will be able to add YT videos to your playlists again, even while plug.dj is dealing with YouTube's support to get this issue fixed.
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 | |
find src/ -type f -name *.proto | | |
while read filePath; do | |
# do something with the file | |
fileName=`basename ${filePath}` | |
echo -n "### checking ${fileName}: " | |
msgs="" | |
enuns="" | |
foundDefs=`grep "message\s\+[a-zA-Z0-9\-\_]\+.*" ${filePath} | sed "s/\s*message\s\+\([a-zA-Z0-9\-\_]\+\).*/\1/"` | |
if [ -n "${foundDefs}" ]; then |
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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
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
/* usbreset -- send a USB port reset to a USB device */ | |
/** | |
* usage `./usbreset /dev/bus/usb/<bus-number>/<device-number>` | |
* use `lsusb` to get <bus-number> and <device-number>. | |
*/ | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <errno.h> | |
#include <sys/ioctl.h> |
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
float watt_average = 0; | |
float measuredvalue = 0; | |
float measuredvalue1 = 0; | |
float measuredvalue2 = 0; | |
float digstepV = 0.0080566; // IS MULTIPLIED BY 10 | |
float voltage = 230; // the net voltage | |
int tel = 1; | |
char var; | |
float longaverage = 0; |
NewerOlder