Skip to content

Instantly share code, notes, and snippets.

View datagutten's full-sized avatar

Anders Birkenes datagutten

  • StorFollo IKT
  • Kolbotn
View GitHub Profile
@theodric
theodric / zyxel_nr7101_setup_hacks_tips_and_tweaks.txt
Last active May 29, 2024 19:47
Zyxel NR7101 setup/hacks/tips and tweaks
0. Don't have a SIM card in when you're updating radio firmware or it will bomb out partway through as it changes from internal IP to IP passthrough
1. Disable external IP passthrough mode: Network Setting -> Broadband -> Cellular APN -> #1 -> Modify icon -> "IP Passthrough" slider to off
2. Use "management" Wi-Fi AP as general Wi-Fi AP (with limitations) -> Network Setting -> Bridge1 -> Modify icon -> Move the Wi-Fi AP interface to the pane on the right alongside LAN1
NOTE: by default, once you do the above, the router will happily pass traffic from devices on the Wi-Fi AP to other devices on the LAN1 subnet, but will block traffic originating from the Wi-Fi AP from exiting to the Internet via the LTE side of the device. You can clumsily hack around this by setting another device, e.g. another Wi-Fi AP or Raspberry Pi or Cray supercomputer, as the default gateway for the LAN1 subnet in your DHCP server config, and pointing *that* device at the Zyxel as *its* default GW. This adds additional hops, but enabl
@schiffty
schiffty / frames_to_TC.py
Last active July 27, 2021 06:00
Frames to Timecode in Python
def frames_to_TC (frames):
h = int(frames / 86400)
m = int(frames / 1440) % 60
s = int((frames % 1440)/24)
f = frames % 1440 % 24
return ( "%02d:%02d:%02d:%02d" % ( h, m, s, f))
# Breakdown of the steps above:
# Hours: Divide frames by 86400 (# of frames in an hour at 24fps). Round down to nearest integer.
#!/usr/bin/python
#
# This script will provides a reverse-search on Packagist to find which libraries uses a given library package
# as a dependency.
#
# Usage:
# First, you need to fetch dependencies: ./packagist.py --fetch
# After, you can start checking packages: ./packagist.py --package <package-name>
#
# Author: Vincent Composieux <vincent.composieux@gmail.com>
@beardedinbinary
beardedinbinary / wp-install.sh
Last active October 6, 2023 01:13
Automated Wordpress Install Script
#!/bin/bash
# Install script for Latest WordPress on local dev
# Setup
# Hardcoded variables that shouldn't change much
# Path to MySQL
MYSQL='/usr/bin/mysql'
@LordSputnik
LordSputnik / eac-cue-submit-isrc.py
Last active July 9, 2017 07:32
A quick little script I wrote for scanning all the EAC CUE files in a single directory, and uploading any contained ISRCs to MusicBrainz.
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Copyright 2013 Ben Ockmore
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@mems
mems / gist:5301297
Last active February 23, 2022 13:12
How to convert a (simple) SWF to PDF

Convert (simple) SWF to PDF

In SWFTools a programs called gfx2gfx is available to do this task, but it's not officially available precompiled.

It can convert SWF, PDF or image to SWF, PDF, ebook or image.

For discard downscaling for rasterized image (default: 72dpi) we use the provided by @m-p-y: add -r attribute to increase maxdpi

Requirements

@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@chrisbloom7
chrisbloom7 / longest_common_substring.php
Created June 12, 2011 03:27
Find the longest common substring in an array of strings (PHP)
<?php
function longest_common_substring($words)
{
$words = array_map('strtolower', array_map('trim', $words));
$sort_by_strlen = create_function('$a, $b', 'if (strlen($a) == strlen($b)) { return strcmp($a, $b); } return (strlen($a) < strlen($b)) ? -1 : 1;');
usort($words, $sort_by_strlen);
// We have to assume that each string has something in common with the first
// string (post sort), we just need to figure out what the longest common
// string is. If any string DOES NOT have something in common with the first
// string, return false.