Skip to content

Instantly share code, notes, and snippets.

View Rainyan's full-sized avatar
💭
I may be slow to respond.

Rain Rainyan

💭
I may be slow to respond.
  • Finland
  • 20:26 (UTC +03:00)
View GitHub Profile
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)
;; Get more packages from Melpa.
(require 'package)
(add-to-list 'package-archives
'("melpa-stable" . "https://stable.melpa.org/packages/") t)
[MouseSettings]
Sensitivity=1
Acceleration=0.02
SensitivityCap=6.75
SpeedCap=0
Offset=0
Power=2
Pre-ScaleX=1
Pre-ScaleY=1
Post-ScaleX=0.12504375
@Rainyan
Rainyan / debug_example.sh
Last active October 18, 2019 18:56
ptrace toggling kludge for debug stuff
#!/bin/bash
# This script toggles ptrace protection for attaching a debugger during development.
# kernel.yama.ptrace_scope = 0: all processes can be debugged, as long as they have same uid. This is the classical way of how ptracing worked.
# kernel.yama.ptrace_scope = 1: only a parent process can be debugged.
# kernel.yama.ptrace_scope = 2: Only admin can use ptrace, as it required CAP_SYS_PTRACE capability.
# kernel.yama.ptrace_scope = 3: No processes may be traced with ptrace. Once set, a reboot is needed to enable ptracing again.
# Need sudo for this script.
@Rainyan
Rainyan / nico_batch_dl.ps1
Last active November 12, 2019 15:50
PowerShell script to persistently download from Nicovideo using ytdl resume state despite connection timeouts / keepalive failures. This is just a crude kludge around this ytdl issue: https://github.com/ytdl-org/youtube-dl/issues/14582
[CmdletBinding()]
param (
[Parameter(Mandatory=$True,Position=1)]
[string]$download_url,
# Where to store downloaded file
[string]$download_location = (Split-Path $MyInvocation.MyCommand.Path),
[string]$download_tool = "youtube-dl",
# If download stops, try resume this many times at most
[int]$max_iterations = 10000,
@Rainyan
Rainyan / Download_Unzip_Verify_SteamCMD.cpp
Last active November 28, 2019 08:39
C++ snippet to download (Windows) SteamCMD, unzip it, and then verify its integrity.
// C++ snippet to download (Windows) SteamCMD, unzip it, and then verify its integrity.
// Tested very little, use at your own risk.
#include <iostream>
#include <vector>
#include <fstream>
#include <iterator>
#include <stdarg.h>
#include <tchar.h>
#include <string>
@Rainyan
Rainyan / symlink_vpks.cmd
Last active May 11, 2020 16:47
REM Set links for large amounts of "pak01_nnn.vpk" files.
@Rainyan
Rainyan / nt_propstester.sp
Last active June 24, 2020 16:33
SourceMod test plugin to spawn all NT prop models at map origin, one at a time. TODO: precache will overflow; either clear string table or keep track of available edicts and force mapchange periodically to flush.
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#define PLUGIN_VERSION "0.1"
public Plugin myinfo = {
name = "NT Props Tester",
description = "Spawn all NT props.",
@Rainyan
Rainyan / hosts-check.py
Last active July 9, 2020 03:37
Check hosts file for dodgy entries
#!/usr/bin/env python
import argparse, os, platform, sys
def is_safe(line):
if (is_empty_line(line) or
is_comment(line) or
is_safe_redir(line)):
return True
return False
@Rainyan
Rainyan / settings.json
Last active October 12, 2020 05:19
mouse accel profile
{
"Degrees of rotation": 0.0,
"Use x as whole/combined accel": true,
"Accel modes": {
"x": "classic",
"y": "noaccel"
},
"Accel parameters": {
"x": {
"offset": 0.0,