Skip to content

Instantly share code, notes, and snippets.

@altmind
altmind / gcc-opts.py
Created December 17, 2023 22:17
gcc march compile options
#!/usr/bin/python
import re
import subprocess
def get_supported_marches():
# gcc -c -Q -march=native --help=target
res = subprocess.getoutput("gcc -c -Q -march=native --help=target")
match = re.search(r" valid arguments for -march= option:\W*([^\r\n]+)", res, re.DOTALL)
if match:
@altmind
altmind / TcpProxy.cs
Created November 17, 2022 21:50 — forked from Mordo95/TcpProxy.cs
Asynchronous TCP proxy in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace HolePunchTest
{
public class TcpProxy
@altmind
altmind / TcpProxy.cs
Created November 17, 2022 21:50 — forked from Mordo95/TcpProxy.cs
Asynchronous TCP proxy in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace HolePunchTest
{
public class TcpProxy
@altmind
altmind / update-dns.py
Created May 30, 2021 23:43
update-dns.py cloudflare ddns
#!/usr/bin/python3
import json
import socket
import sys
import urllib.request
host = sys.argv[1] if (len(sys.argv) >= 2) else socket.gethostname()
target_hostname = "%s.sub.yournet.com" % host
zone_id = "REMOVEDREMOVEDREMOVED"
token = "REMOVEDREMOVEDREMOVED"
@altmind
altmind / windows_hardening.cmd
Created May 10, 2020 14:31 — forked from mackwage/windows_hardening.cmd
Script to perform some hardening of Windows OS
:: Windows 10 Hardening Script
:: This is based mostly on my own personal research and testing. My objective is to secure/harden Windows 10 as much as possible while not impacting usability at all. (Think being able to run on this computer's of family members so secure them but not increase the chances of them having to call you to troubleshoot something related to it later on). References for virtually all settings can be found at the bottom. Just before the references section, you will always find several security settings commented out as they could lead to compatibility issues in common consumer setups but they're worth considering.
:: Thank you @jaredhaight for the Win Firewall config recommendations!
:: Thank you @ricardojba for the DLL Safe Order Search reg key!
:: Best script I've found for Debloating Windows 10: https://github.com/Sycnex/Windows10Debloater
::
::#######################################################################
::
:: Change file associations to protect against common ransomware
@altmind
altmind / oo-shutup10-privacy.reg
Created March 8, 2020 10:17
oo-shutup10-privacy.reg
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\FlipAhead]
"FPEnabled"=dword:00000000
[HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\Main]
"ShowSearchSuggestionsGlobal"=dword:00000000
"DoNotTrack"=dword:00000001
[HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\ServiceUI]
<#
.NOTES
===========================================================================
Created on:2018.11.09
Latest Update: 2018.12.15
Script Version:1.1.3
Author:Timothy Gruber
Website: TimothyGruber.com
GitLab:https://gitlab.com/tjgruber/win10crappremover
===========================================================================
@altmind
altmind / key.md
Created December 16, 2018 20:53
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA

todomvc\tests>mocha allTests.js --no-timeouts --reporter spec "--framework=rivets" "--framework=rivets" "--framework=rivets" "--framework=rivets" "--framework=rivets" "--framework=rivets"
TodoMVC - rivets
When page is initially opened
√ should focus on the todo input field (78ms)
No Todos
√ should hide #main and #footer (155ms)
New Todo
√ should allow me to add todo items (578ms)
function parseUrl(url) {
if ($.type(url) === "object") {
return url;
}
var matches = /^(((([^:\/#\?]+:)?(?:\/\/((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?]+)(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/.exec(url);
return matches ? {
href:matches[0] || "",
hrefNoHash:matches[1] || "",
hrefNoSearch:matches[2] || "",
domain:matches[3] || "",