Skip to content

Instantly share code, notes, and snippets.

@yamao2253
yamao2253 / config.txt.hdmi_480x320
Created January 11, 2019 22:38
Raspberry Pi /boot/config.txt for HDMI 480x320
# 3.5inch HDMI 480x320
hdmi_group=2
hdmi_mode=87 # Custom mode
hdmi_cvt=480 320 60 6 0 0 0
framebuffer_width=480
framebuffer_height=320
@tommy-mor
tommy-mor / video.py
Last active January 3, 2024 21:59
not good code stay away
from moviepy.editor import *
import numpy as np
clip = VideoFileClip("hams.mkv")
import sounddevice as sd
import soundfile as sf
from queue import Queue
from collections import OrderedDict
import pprint
pp = pprint.PrettyPrinter(indent=4)
print('started')
#https://nims11.wordpress.com/2013/05/22/using-hostapd-with-dnsmasq-to-create-virtual-wifi-access-point-in-linux/
#!/bin/bash
#Initial wifi interface configuration
ifconfig $1 up 10.0.0.1 netmask 255.255.255.0
sleep 2
###########Start dnsmasq, modify if required##########
if [ -z "$(ps -e | grep dnsmasq)" ]
then
dnsmasq
@resilar
resilar / pam_badlog.c
Last active November 27, 2018 13:51
PAM module to log bad SSH passwords (for non-/home/ users only)
/*
* pam_badlog.c
*
* $ gcc -fPIC -fno-stack-protector -c pam_badlog.c
* $ sudo ld -x --shared -o /lib/security/pam_badlog.so pam_badlog.o
* $ rm pam_badlog.o
*
* then add "auth required pam_badlog.so" in the beginning of /etc/pam.d/sshd
*
* $ /etc/init.d/sshd restart
@monsieurh
monsieurh / lutim.py
Created July 22, 2016 10:44
Uploads an image to LUTIM (http://lut.im/)
#!/usr/bin/env python3
import argparse
import os
import sys
import requests
from bs4 import BeautifulSoup
@bhundven
bhundven / nineteen.sh
Last active November 22, 2023 17:06
Enlightenment 19 build script for Ubuntu/Debian
#!/bin/bash
# vi: ts=4:sw=4:et
#
# NINETEEN.SH
# This script allows you to install/update Enlightenment 19 git version on
# Ubuntu 14.04 LTS or Debian wheezy/sid, or remove E19 git from your system.
# Originally from: http://ubuntuforums.org/showthread.php?t=2203190
# By: Philippe J. Guillaumie (batden AT sfr DOT fr).
# Additional updates by: Bryan Hundven (bryanhundven AT gmail DOT com).
#
@AGWA
AGWA / rpi-hdmi.sh
Last active March 18, 2024 06:04
Enable and disable the HDMI port on the Raspberry Pi: `rpi-hdmi on` to turn on, `rpi-hdmi off` to turn off. X is properly reinitialized when re-enabling.
#!/bin/sh
# Enable and disable HDMI output on the Raspberry Pi
is_off ()
{
tvservice -s | grep "TV is off" >/dev/null
}
case $1 in
@unixdj
unixdj / :etc:config:network
Last active January 31, 2018 11:05
OpenWRT: STA+AP on TP-Link TL-WR703N. Network configuration for OpenWRT that enables two VAPs, one as a client (STA) for uplink (wan interface) and another as an access point bridged with eth0 (lan bridge). NAT is already provided. TL-WR703N has Atheros AR9331 wireless with one antenna and no network switch.
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fdxx:xxxx:xxxx::/48'
config interface 'lan'
@SaveTheRbtz
SaveTheRbtz / linux_tcp_timeout_knobs.patch
Last active June 24, 2021 14:02
On the fly TCP timeout tuning for linux-3.2
commit 99f490afdc91d4965aafd5629567ef02c515e169
Author: Alexey Ivanov <rbtz@yandex-team.ru>
Date: Tue Apr 17 16:55:10 2012 +0400
YANDEX: tcpm: Added TCP sysctl tunables
I made following constants tunable for internal testing:
TCP_DELACK_MIN -> net.ipv4.tcp_delack_min
TCP_DELACK_MAX -> net.ipv4.tcp_delack_max
TCP_ATO_MIN -> net.ipv4.tcp_ato_min