Skip to content

Instantly share code, notes, and snippets.

View Anime4000's full-sized avatar

Anime4000

View GitHub Profile
@dck-jp
dck-jp / reboot.cs
Created October 6, 2012 09:59
Reboot/ Shutdown / Suspend on Windows8 By using C#
using System.Diagnostics;
namespace Reboot
{
class Program
{
static void Main(string[] args)
{
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = "shutdown.exe";
@shilrobot
shilrobot / package.sh
Created June 27, 2012 16:54
Making mkbundle work on Windows
#!/bin/bash
# If this doesn't work, ensure you have UNIX line endings in this file
# (\n, not \r\n.) You can use Notepad++ to switch them.
# Cygwin package requirements: gcc-mingw, pkg-config
# If you want to pass -z to mkbundle: mingw-zlib1, mingw-zlib-devel
# crash immediately if anything bad happens
set -o errexit
set -o nounset
@strangerstudios
strangerstudios / my_pmpro_getfile.php
Last active September 13, 2018 15:19
How to protect non-WordPress files in a subdirectory of your site using Paid Memberships Pro.
<?php
/*
This code handles loading a file from the /protected-directory/ directory.
(!) Be sure to change line 44 below to point to your protected directory if something other than /protected/
(!) Be sure to change line 64 below to check the levels you need.
(!) Add this code to your active theme's functions.php or a custom plugin.
(!) You should have a corresponding bit of code in your Apache .htaccess file to redirect files to this script. e.g.
###
@dave1010
dave1010 / htaccess
Created December 14, 2011 13:07
HTTP Status Cats Apache (htaccess) config
# HTTP Status Cats
# Apache (htaccess) config created by @dave1010
# Licensed CC BY 2.0
# Images CC BY 2.0, from GirlieMac's photostream:
# http://www.flickr.com/photos/girliemac/sets/72157628409467125/with/6508023065/
# Usage: copy save this file as .htaccess or add it to your httpd.conf
ErrorDocument 404 '<a href="http://www.flickr.com/photos/girliemac/6508022985/" title="404 - Not Found by GirlieMac, on Flickr"><img src="http://farm8.staticflickr.com/7172/6508022985_b22200ced0.jpg" width="500" height="400" alt="404 - Not Found"></a>'
@aspose-com-gists
aspose-com-gists / find-replace-text-pdf-page.cs
Created December 23, 2020 03:48
Find and Replace Text in PDF C#
// Open document
Document pdfDocument = new Document("Document.pdf");
// Create TextAbsorber object to find all instances of the input search phrase
TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber("text");
// Accept the absorber for desired
pdfDocument.Pages[1].Accept(textFragmentAbsorber);
// Get the extracted text fragments
@rajkosto
rajkosto / RTL960x_features.txt
Created December 14, 2022 23:36
ODI DFP-34X-2C2 / RTL960x chipset SDK feature bits description
HGU firmware features:
0 BDP (OMCI_CUSTOM_BDP):
0x001 = KERNEL:TLS_4095 = (0)tls_4095_us_rule_to_ds_rule, (1)tls_4095_us_act_to_ds_sact, (2)tls_4095_us_act_to_ds_cact, (3)tls_4095_us_set_mbr_port_by_svlan, (4)tls_4095_us_del_mbr_port_by_svlan
0x002 = KERNEL:ignore_dsPbit = (5)ignore_ds_pbit, this one is very slightly different (less magic values) in SFU firmware
0x008 = (15)cf_gen_vtfd_rule, (14)cf_check_vtfd_mode
0x010 = KERNEL:set_ds_bc_gem_flow_to_ds_bcster_mod = (6)omci_apply_ds_bcster_mod, (7)omci_set_ds_bc_gem_flow_to_ds_bcster_mod,
KERNEL:add_ds_tag_rule_to_ds_bcster_mod = (8)omci_add_ds_tag_rule_to_ds_bcster_mod, (9)omci_del_ds_tag_rule_to_ds_bcster_mod
KERNEL:reset_to_ds_bcster_mod = (10)omci_reset_to_ds_bcster_mod,
0x080 = (18)omci_ingoreExtVlanDefaultDrop (parameter & 0x01 => IGN_ME_171_DEFAULT_DROP, parameter & 0x02 => IGN_ME_171_TREAT_UNTAG, parameter == -1 ?)
0x100 = KERNEL:force_veip_rule_to_sfu = (13)force_veip_rule_to_sfu, (14)force_veip_us_r
@Anime4000
Anime4000 / terminal.md
Last active March 18, 2024 12:55
Mikrotik LTE Change IMEI

Change Mikrotik LTE IMEI

Query which mode

/interface lte at-chat lte1 input="AT*PROD\?"

Enter Non-production mode

/interface lte at-chat lte1 input="AT*PROD=1"

Delete old IMEI

/interface lte at-chat lte1 input="AT*MRD_IMEI=D"

@natowi
natowi / audio2midi.md
Last active April 18, 2024 11:37
List of open source audio to midi packages
@harubaru
harubaru / wd1-3-release.md
Last active April 20, 2024 04:35
Official Release Notes for Waifu Diffusion 1.3
@Ciantic
Ciantic / cloudflare-dyndns-a-aaaa-record-update.sh
Last active April 27, 2024 13:03
cloudflare dyndns script / update a A and AAAA record using bash script
#!/bin/bash
# Author: Jari Pennanen
# Url: https://gist.github.com/Ciantic/4e543f2d878a87a38c25032d5c727bf2
AUTH_EMAIL="john.doe@example.com" # Your Cloudflare email
AUTH_KEY="" # Get this from My profile -> API Keys -> View
DOMAIN="example.com" # main domain
SUBDOMAIN="home.example.com" # set A and AAAA-record of this subdomain