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
import i2clcd | |
import time, datetime, subprocess, re | |
lcd = i2clcd.lcd(0x38,1) | |
matcher = re.compile("0% packet loss") | |
while True: | |
date = datetime.datetime.now().strftime("%H:%M:%S") | |
ping = subprocess.Popen(["ping", "-c", "1", "neti.ee"],stdout = subprocess.PIPE,stderr = subprocess.PIPE) | |
out, error = ping.communicate() | |
lcd.lcd_clear() | |
lcd.lcd_puts("Time: {}".format(date), 1); |
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 <sys/mount.h> | |
int r; | |
const char *targ = "/mnt"; | |
const char *src = "/home/mark/lx/m.squash"; | |
const char *fs = "squashfs"; | |
unsigned long mflags; | |
const void *data; | |
int main(){ | |
r = mount(src,targ,fs,mflags,data); |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
void parseargv(char *l, char **a){ | |
while(*l != '\0') { | |
while (*l == ' ' || *l == '\t' || *l == '\n') |
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
<html> | |
<meta charset="utf-8"> | |
<body> | |
<h1>Led test</h1> | |
<button onClick="b()"><span id="lol"></span></button> | |
<script> | |
var is_running="<?php | |
if($_GET["run"] == "1"){ | |
shell_exec("/home/pi/suid -c '/home/pi/vilguta.sh' >/dev/null"); echo "1"; | |
} else if($_GET["run"] == "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
[Desktop Entry] | |
Type=Application | |
Name=Fortune notification | |
Comment=Fortune in notification | |
Exec=/home/mark/bin/fortune.py | |
OnlyShowIn=GNOME; | |
X-GNOME-Autostart-Phase=Application |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <sys/un.h> | |
#include <unistd.h> | |
#define SOCK_PATH "echo_socket" |
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
#!/usr/bin/env bash | |
0x0() { | |
case "${1}" in | |
"s") | |
shift | |
local url=`curl --silent -F"shorten=${1}" https://0x0.st | sed 's/\n//'` | |
echo -n "${url}" | |
;; | |
"u") |
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
#!/usr/bin/env python3 | |
#Deps: https://github.com/leonnnn/python3-simplepam | |
from simplepam import authenticate | |
import getpass | |
import os | |
import time | |
import sys | |
import socket | |
hostname = socket.gethostname() | |
x = 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
" ###### Many settings, wow' | |
" Better tab completion | |
set wildmode=longest,list,full | |
" Airline does this already | |
set noshowmode | |
" Do not use double space on some characters | |
set ambiwidth=single | |
" Remove startup screen | |
set shortmess+=I |
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
# http://www.peterbe.com/plog/uniqifiers-benchmark | |
def uniqify(seq, idfun=None): | |
# order preserving | |
if idfun is None: | |
def idfun(x): return x | |
seen = {} | |
result = [] | |
for item in seq: | |
marker = idfun(item) |