Skip to content

Instantly share code, notes, and snippets.

View toxuin's full-sized avatar

Toxuin toxuin

  • SurveyMonkey
  • Calgary, Canada
View GitHub Profile
@toxuin
toxuin / gist:b6047b0f3269106fb95d
Last active April 5, 2023 12:31
Use mac diskutil in single-user mode
/sbin/fsck -fy
mount -uw /
launchctl load /System/Library/LaunchDaemons/com.apple.notifyd.plist
launchctl load /System/Library/LaunchDaemons/com.apple.configd.plist
launchctl load /System/Library/LaunchDaemons/com.apple.diskmanagementd.plist
launchctl load /System/Library/LaunchDaemons/com.apple.securityd.plist
launchctl load /System/Library/LaunchDaemons/com.apple.diskarbitrationd.plist
diskutil rename Macintosh_HD Macintosh\ HD
@toxuin
toxuin / config.yml
Created August 16, 2022 17:28
Alarmserver with EMQX test config
debug: true
hisilicon:
enabled: true
port: 15002
ftp:
enabled: true
port: 21
password: "test"
@toxuin
toxuin / ∕apis∕extensions∕v1beta1∕ingresses.json
Created November 20, 2019 22:22
Kubernetes ingress resources
{
"kind": "IngressList",
"apiVersion": "extensions/v1beta1",
"metadata": {
"selfLink": "/apis/extensions/v1beta1/ingresses",
"resourceVersion": "27593873"
},
"items": [
{
"metadata": {
@toxuin
toxuin / sendmail.php
Created March 22, 2012 21:55
php send mail script
<?
/* Скрипт умеет слать на почту данные из веб-формы и вставлять в письмо приложенное изображение.
Картинки складываются в папку mailpictures, так что не забудьте создать ее.
*/
// В какой кодировке приходят данные.
$incoming_encoding = 'Windows-1251';
// Почта куда слать сообщения.
$address = "houi.peesda@jeegourda.com";
// Максимальная разрешенная ширина загружаемого изображения
@toxuin
toxuin / request.sql
Created March 22, 2012 22:22
Show people having more than one character on Minecraft server running AuthMe in SQL mode
SELECT * FROM `authme` WHERE `ip` IN (SELECT `ip` FROM `authme` GROUP BY `ip` HAVING (COUNT(`ip`) > 1)) ORDER BY `ip` ASC;
@toxuin
toxuin / gist:c1b9f6812d6e4c7787d6
Created April 12, 2015 20:32
Router simulation
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Inet4Address;
import org.apache.commons.net.util.SubnetUtils;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;