Skip to content

Instantly share code, notes, and snippets.

View benyaminl's full-sized avatar
😬
Crazy with C#

Benyamin Limanto benyaminl

😬
Crazy with C#
View GitHub Profile
@drmalex07
drmalex07 / README-setup-tunnel-as-systemd-service.md
Last active April 7, 2025 13:24
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/[email protected]. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
@fardjad
fardjad / center-active-window.ahk
Last active June 29, 2021 03:19
[center-active-window.ahk] An AutoHotkey script to make WinKey+C center active window #autohotkey #windows
; Courtesy of http://superuser.com/a/403191
^#c::
WinGetTitle, windowName, A
CenterWindow(windowTitleVariable) {
WinGetPos,,, Width, Height, %windowTitleVariable%
WinMove, %windowTitleVariable%,, (A_ScreenWidth - Width) / 2, (A_ScreenHeight - Height) / 2
}
@martynjarvis
martynjarvis / dnsapi.dll.md
Last active August 19, 2024 09:08
Fix dnsapi.dll error when running EVE online with Wine

Problem

Launcher would correctly load. However, the game would not launch from the launcher.

The following line was seen in output

err:module:import_dll Library DNSAPI.dll

Solution

@DrLulz
DrLulz / mpv-bookmarks.lua
Last active June 9, 2022 11:57
Creates .edl file for MPV player used here as a bookmarked playlist. Binds "x" so that first press is start of "bookmark" and second press is end of "bookmark." The file produced can then be played using "mpv --playlist=file.edl".
function file_exists(playlist)
local f=io.open(playlist, "r")
if f~=nil then io.close(f) return true else return false end
end
function entry_complete(playlist)
local f=io.open(playlist, "r")
chars = f:read("*all")
last_char = string.sub(chars, -1)
if last_char == ";" then io.close(f) return true else return false end
@hinchley
hinchley / DisableBorder.ps1
Created January 18, 2015 09:03
Disable Microsoft Office 2013 Border Shadow with PowerShell
Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
namespace Utilities {
public static class Display {
private const uint WM_USER = 0x0400;
private const uint WM_MSO = WM_USER + 0x0900;
private const uint WM_MSO_WPARAM_OMFRAMEENABLESHADOW = 0x0075;
@artmouse
artmouse / DKIM_SPF_Sendmail
Created November 25, 2014 13:48
DKIM + SPF + Sendmail for multiple domains (Ubuntu)
DKIM is DomainKeys Identified Mail and is used in mail servers, such as Postfix or Sendmail to sign e-mails and thus authenticating the sender so that a forgery can be detected. It also reduces the possibility of an e-mail being flagged as spam, but it's not a definite prevention.
A much simpler method is using SPF (Sender Policy Framework) which, in a nutshell, verifies the sender IP address.
According to the internet, using both should result to ????, PROFIT !!!.
SPF does not need a specific configuration. Whitelisted servers are listed in a DNS record, TXT or SPF, and an example record is:
example.com. IN TXT "v=spf1 a mx ~all"
@mul14
mul14 / 00_etc-hosts.md
Last active April 29, 2025 10:10
/etc/hosts for Vimeo, Reddit, Imgur, GitHub, DigitalOcean, dll

Unblock Steam, Vimeo, Reddit, Imgur, GitHub, DigitalOcean, NPM, PayPal, dll

Saya support Internet Positif untuk memblokir porn, situs judi, dan hal-hal ilegal lainnya. Tapi pemerintah dan ISP sangat konyol karena tidak mengizinkan akses ke Vimeo, Reddit, Imgur, Netflix--yang mana bukanlah situs dengan konten utama ilegal.

Linux / BSD / macOS

Tambahkan list di bawah ke /etc/hosts.

Windows

@dotJoel
dotJoel / google-webfonts.ttf.css
Last active August 19, 2024 21:30
CSS for all of Google's TTF web fonts
@font-face {
font-family: 'ABeeZee';
font-style: normal;
font-weight: 400;
src: local('ABeeZee'), local('ABeeZee-Regular'), url(http://themes.googleusercontent.com/static/fonts/abeezee/v1/JYPhMn-3Xw-JGuyB-fEdNA.ttf) format('truetype');
}
@font-face {
font-family: 'Abel';
font-style: normal;
font-weight: 400;
@cobyism
cobyism / diy-cardboard-laptop-stand.md
Created February 4, 2013 15:26
DIY Cardboard Laptop Stand

DIY Cardboard Laptop Stand

DSCF0319

Here’s how to make your own laptop stand out of cardboard.

Ingredients

  • One piece of cardboard, approximately 53cm wide x 14cm high (cut up an old parcel box or something).
  • Scissors
@cdown
cdown / gist:1163649
Last active April 14, 2025 22:42
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in