Skip to content

Instantly share code, notes, and snippets.

View danny-source's full-sized avatar

DannySTW danny-source

View GitHub Profile
@LanceMcCarthy
LanceMcCarthy / vpn-config-updater.sh
Last active August 24, 2023 15:18
UDM Pro IPsec VPN Configuration Updater
#!/bin/sh
# ***** warning ***** warning ***** warning ***** warning ***** warning ***** warning *****
# THIS IS NOT LONGER A GOOD APPROACH TO USE. SCROLL DOWN TO THE COMMENTS TO SEE HOW YOU CAN USE WIREGUARD WITH A DDNS FQDN INSTEAD
# ***** warning ***** warning ***** warning ***** warning ***** warning ***** warning *****
# ___ ____ _ _ _ _
# |_ _| _ \ ___ ___ ___ | | | |_ __ __| | __ _| |_ ___ _ __
@Inndy
Inndy / make_certs.sh
Created May 9, 2019 07:56
Self sign root CA and certs with x509v3 subjectAltName record
#!/usr/bin/env bash
set -e
SUBJ="/C=TW/ST=Taiwan/L=TPE/O=Goooooooooogle/OU=Goooooooooogle DevOops Team/emailAddress=reboot@goooooooooogle.com"
ROOT_CA_NAME=GoooooooooogleRootCA
ROOT_CA_DAYS=$((365*4))
ROOT_CA_BITS=8192
@lightrush
lightrush / README.md
Created November 3, 2017 05:18
X11vnc Systemd Unit File

X11vnc Systemd Unit File

This Systemd unit file starts X11VNC on boot

  1. Set VNC password: sudo x11vnc -storepasswd [YOUR VNC PASSWORD] /etc/x11vnc.passwd
  2. Install Systemd Unit File
sudo cp [path to]/vnc.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable vnc.service
@Elecon-rou
Elecon-rou / if.c
Created January 26, 2017 22:32
List all network interfaces with netlink
#include <stdio.h>
#include <unistd.h>
#include <memory.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <linux/types.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#define BUF_SIZE 8192
@JustinTW
JustinTW / login-cht-wifi.sh
Last active April 22, 2024 02:58
Auto login cht-wifi for dd-wrt
#!/bin/sh
# description: check cht-wifi login status, and auto login if no login.
# default script path: /mnt/sda1/mnt/scripts/login-cht-wifi.sh
# author: JustinTWD <justintwd@gmail.com>
# date: 2016/03/12
USERNAME=YOUR_CHT_ACCOUNT
PASSWD=YOUR_CHT_PASSWORD
LOGFILE=/mnt/sda1/log/cht-wifi.log
TMPSESSION=/tmp/cht_session.tmp
@rajabishek
rajabishek / multiclient.c
Created November 1, 2015 19:13
Multiple Client Handling TCP Server
/**
Handle multiple socket connections with select and fd_set on Linux
Raj Abishek <rajabishek@hotmail.com>
*/
#include <stdio.h>
#include <string.h> //strlen
#include <stdlib.h>
#include <errno.h>
#include <unistd.h> //close
@gskema
gskema / db.php
Created September 1, 2015 11:15
PHP PDO bulk INSERT
<?php
class Db
{
public function batchInsert($table, array $rows, array $columns = array())
{
// Is array empty? Nothing to insert!
if (empty($rows)) {
return true;
}
@grenade
grenade / 01-generate-ed25519-ssh-key.sh
Last active April 14, 2024 14:27
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
#!/bin/bash
# generate new personal ed25519 ssh key
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <rthijssen@gmail.com>"
# generate new host cert authority (host_ca) ed25519 ssh key
# used for signing host keys and creating host certs
ssh-keygen -t ed25519 -f manta_host_ca -C manta.network
eval "$(ssh-agent -s)"
@superbrothers
superbrothers / ansi-color.php
Created August 23, 2012 01:49
ANSI color terminal output module for php
<?php
/**
* php-ansi-color
*
* Original
* https://github.com/loopj/commonjs-ansi-color
*
* @code
* <?php
* require_once "ansi-color.php";