Skip to content

Instantly share code, notes, and snippets.

@sirkkalap
sirkkalap / mouse-wasd.ahk
Created December 10, 2023 21:01
AutoHotkey script to type WASD keys using relative mouse movements when RShift is pressed.
#Persistent
SetTimer, CheckMouse, 10
return
; Initialize state variables
WDown := false
ADown := false
SDown := false
DDown := false
@sirkkalap
sirkkalap / blender-markers-to-csv.py
Created November 30, 2020 11:31
Write Blender sequencer markers to a CSV file
# From: https://www.quollism.com/b/archives/113
#
# "You can copypaste this script straight into Blender’s text editor and hit
# “Run Script” to output filename_frames.csv in the directory right next to
# your currently open file. Yay!"
#
import bpy
import csv
import os
@sirkkalap
sirkkalap / Install-Docker-on-Linux-Mint.sh
Last active December 8, 2022 18:38
Install Docker on Linux Mint
##########################################
# To run:
# curl -sSL https://gist.githubusercontent.com/sirkkalap/e87cd580a47b180a7d32/raw/d9c9ebae4f5cf64eed4676e8aedac265b5a51bfa/Install-Docker-on-Linux-Mint.sh | bash -x
##########################################
# Check that HTTPS transport is available to APT
if [ ! -e /usr/lib/apt/methods/https ]; then
sudo apt-get update
sudo apt-get install -y apt-transport-https
fi
@sirkkalap
sirkkalap / tz-example.sh
Created February 23, 2015 23:17
Ways to set up Docker container's timezone
$ docker run --rm busybox date
Thu Mar 20 04:42:02 UTC 2014
$ docker run --rm -v /etc/localtime:/etc/localtime busybox date
Thu Mar 20 14:42:20 EST 2014
$ FILE=$(mktemp) ; echo $FILE ; echo -e "Europe/Brussels" > $FILE ; docker run --rm -v $FILE:/etc/timezone -v /usr/share/zoneinfo/Europe/Brussels:/etc/localtime busybox date
/tmp/tmp.JwL2A9c50i
Thu Mar 20 05:42:26 CET 2014
Get-Item -Path HKCU:\Software\Microsoft\GameBar -Verbose|ft -a
If (Test-Path HKCU:\Software\Microsoft\GameBar) {Get-Item HKCU:\Software\Microsoft\GameBar|Set-ItemProperty -Name AllowAutoGameMode -Value 1 -Verbose -Force} #Enable Game Mode
If (Test-Path HKCU:\Software\Microsoft\GameBar) {Get-Item -Path HKCU:\Software\Microsoft\GameBar|Set-ItemProperty -Name AllowAutoGameMode -Value 0 -Verbose -Force}

title

Here is some markdown

sudo bash -c 'for p in /Applications/Adobe* /Applications/Utilities/Adobe* /Library/Application\ Support/Adobe /Library/Preferences/com.adobe.* /Library/PrivilegedHelperTools/com.adobe.* /private/var/db/receipts/com.adobe.* ~/Library/Application\ Support/Adobe* ~/Library/Application\ Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.adobe* ~/Library/Application\ Support/CrashReporter/Adobe* ~/Library/Caches/Adobe ~/Library/Caches/com.Adobe.* ~/Library/Caches/com.adobe.* ~/Library/Cookies/com.adobe.* ~/Library/Logs/Adobe* ~/Library/PhotoshopCrashes ~/Library/Preferences/Adobe* ~/Library/Preferences/com.adobe.* ~/Library/Preferences/Macromedia* ~/Library/Saved\ Application\ State/com.adobe.*; do rm -rf $p; done'
@sirkkalap
sirkkalap / curl_list_of_urls.sh
Created June 3, 2019 12:44
Curl a list of urls in a loop
while read u; do
echo $u
curl -I $u
done << EOM
https://www.iki.fi/
http://www.iki.fi/iki/iki-logo-16.gif
EOM
@sirkkalap
sirkkalap / EditCachetIncidentMsg.java
Created July 10, 2017 12:33
A snippet to demonstrate editing Cachet Incident message text.
...
package fi.XXX.digitraffic.status.dto.cachet;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
@JsonIgnoreProperties(ignoreUnknown = true)
public class IncidentEditMsgDto {
public final Integer incident;
## you may need sudo permission to execute some commands or swith to root
# if installed old version by yum, remove it first
yum -y remove tmux libevent libevent-devel libevent-headers
# install deps
yum -y install gcc kernel-devel make ncurses-devel wget
# create temp dir
mkdir /tmp/for-latest-tmux