Skip to content

Instantly share code, notes, and snippets.

View noobping's full-sized avatar
🎓
I may be slow to respond

Nick noobping

🎓
I may be slow to respond
View GitHub Profile
DROP DATABASE IF EXISTS 📚;
CREATE DATABASE 📚;
USE 📚;
CREATE TABLE 👤(
🔑 INTEGER PRIMARY KEY,
🗣 varchar(64), -- name
🗓 DATE -- date of registration
@trandaison
trandaison / starUML.md
Last active May 2, 2024 10:02
Get full version of StarUML
@shamil
shamil / mount_qcow2.md
Last active May 3, 2024 06:35
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@tott
tott / ip_in_range.php
Created November 27, 2013 22:46
php check if IP is in given network range
/**
* Check if a given ip is in a network
* @param string $ip IP to check in IPV4 format eg. 127.0.0.1
* @param string $range IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 is accepted and /32 assumed
* @return boolean true if the ip is in this range / false if not.
*/
function ip_in_range( $ip, $range ) {
if ( strpos( $range, '/' ) == false ) {
$range .= '/32';
}
@psd
psd / validate_conf.sh
Last active January 25, 2024 19:13
use nginx to validate config
#!/bin/bash
#
# validate nginx config
#
# depends upon a symbolic link from /var/apps/redirector to dist directory
# and a build of nginx which supports real_ip and other extensions
#
# probably best to build a chroot'd tree containing a complete nginx server
# though that's a lot of work to copy in shared libraries, etc
@skakri
skakri / mc_status.php
Created March 20, 2012 12:16
Minecraft status (PHP, returns MOTD, online user count, slots, request time)
<?php
/**
* @author Kristaps Karlsons <kristaps.karlsons@gmail.com>
* Licensed under MPL 1.1
*/
function mc_status($host,$port='25565') {
$timeInit = microtime();
// TODO: implement a way to store data (memcached or MySQL?) - please don't overload target server
$fp = fsockopen($host,$port,$errno,$errstr,$timeout=10);