Skip to content

Instantly share code, notes, and snippets.

View levelKro's full-sized avatar
🏠
Working from home

levelKro levelKro

🏠
Working from home
View GitHub Profile
@levelKro
levelKro / steam.php
Created February 4, 2019 11:43
PHP Steam Class (simple reply and use)
<?php
/*
* (c) Copyright Mathieu Légaré (levelkro@yahoo.ca)
* 2013-2019
*/
class SteamLVK {
/* Variables */
const STEAM_LOGIN = 'https://steamcommunity.com/openid';
const STEAM_OPENID = 'http://specs.openid.net/auth/2.0';
const STEAM_COMMUNITY = 'https://steamcommunity.com';
@levelKro
levelKro / virtualmin-dns.php
Created February 4, 2019 11:40
PHP Virtualmin Class for add/update/delete DNS
<?php
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);
ini_set("display_errors", 1);
/*
Virtualmin API Class v1.0
Mathieu Légaré
levelkro@yahoo.ca
https://levelkro.net
@levelKro
levelKro / install-ffmpeg.sh
Created February 4, 2019 11:33
FFMpeg Install CentOS X64 (v7)
#!/bin/bash
yum update
yum install autoconf automake bzip2 cmake freetype-devel gcc gcc-c++ git libtool make mercurial pkgconfig zlib-devel
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
wget http://www.nasm.us/pub/nasm/releasebuilds/2.13.02/nasm-2.13.02.tar.bz2
tar xjvf nasm-2.13.02.tar.bz2
cd nasm-2.13.02
@levelKro
levelKro / iptables-rules.sh
Created February 4, 2019 11:31
Basic IPTables rules
# Add rules for allow; Webmin, Smtp, Pop, FTP, SSH, HTTP, RTMP (Red5), Proxy
# And with form normal, ssl, tls ports
# Just copy and past in command prompt and reload iptables
# Basic ports
iptables -A INPUT -p udp -m udp --dport 20 -j ACCEPT
iptables -A INPUT -p udp -m udp --dport 21 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 20 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 21 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
@gbaman
gbaman / HowToOTG.md
Last active April 16, 2024 22:39
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@icaliman
icaliman / install_ffmpeg_centos.sh
Created March 28, 2015 14:55
Install latest ffmpeg on Centos with libmp3lame enabled
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Centos
# Inspired from https://trac.ffmpeg.org/wiki/CompilationGuide/Centos
# Get the dependencies:
sudo yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
mkdir ~/ffmpeg_sources