Skip to content

Instantly share code, notes, and snippets.

View pldubouilh's full-sized avatar

Pierre Dubouilh pldubouilh

View GitHub Profile
#!/bin/bash
set -e
##### CHECK PARAMETERS #####
PRODUCTION=0
while [[ "$#" -gt 0 ]]; do
case $1 in
-p|--production) PRODUCTION=1 ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;;
esac
shift
@Henje
Henje / papers_please_fix.cpp
Last active February 28, 2023 23:10
Simple hack to disable joystick scanning and remove stutters from Papers Please.
#include <string>
#include <dlfcn.h>
#include <stdio.h>
#include <sys/mman.h>
#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
using namespace std::literals;
@lxpk
lxpk / MPSelectMiniV2-PrusaSlicer_config_bundle.ini
Last active December 14, 2024 17:40 — forked from todbot/MPSelectMiniV2-PrusaSlicer_config_bundle.ini
My attempt at a PrusaSlicer config bundle for Monoprice Select Mini V2. Import with "File" -> "Import..." -> "Import Config Bundle"
# generated by PrusaSlicer 2.2.0+ on 2020-04-02 at 04:02:32 UTC
[print:0.175mm - Monoprice Mini Select v2]
avoid_crossing_perimeters = 0
bottom_fill_pattern = rectilinear
bottom_solid_layers = 3
bottom_solid_min_thickness = 0
bridge_acceleration = 0
bridge_angle = 0
bridge_flow_ratio = 1
@natanlao
natanlao / syncthing-photo-sync.md
Last active February 23, 2025 18:47
Syncing iPhone photos with Syncthing

For those who prefer to avoid solutions like iCloud Photos and Dropbox for backing up photos, you can sync your iPhone photos with Syncthing. To do this, you'll need two things:

  • Möbius Sync is, to my knowledge, the only actively-maintained Syncthing client for iOS. It's free to sync up to 20 MB, and only $4.99 (one-time) to remove that limit.

  • PhotoSync is a nifty iOS app for syncing photos to a number of different destinations. It's free for low-quality

#!/bin/bash
# author: Pushpal Sidhu <[email protected]>
# date: 20180620
#
# Place this into the file "/lib/systemd/system-sleep/keybase-suspend"
# and mark it executable.
# Copied out of /usr/bin/run_keybase on 20180620. It'd be nice if they
# allowed run_keybase to be sourced then call the kill_all() function
@jgrahamc
jgrahamc / pwnd.js
Created February 24, 2018 16:36
Cloudflare Workers that adds an "Cf-Password-Pwnd" header to a POST request indicating whether the 'password' field appears in Troy Hunt's database of pwned passwords.
addEventListener('fetch', event => {
event.respondWith(fetchAndCheckPassword(event.request))
})
async function fetchAndCheckPassword(req) {
if (req.method == "POST") {
try {
const post = await req.formData();
const pwd = post.get('password')
const enc = new TextEncoder("utf-8").encode(pwd)
pragma solidity ^0.4.0;
import "SafeMath.sol";
import "IERC20Token.sol";
/**
* @dev Implements a capped token sale using a second-price auction.
*
* @author Nick Johnson <[email protected]>
*
@2E0PGS
2E0PGS / linux-usb-file-copy-fix.md
Last active October 2, 2025 13:18
Fix Ubuntu and other Linux slow/hanging file copying via USB.

If your running a x64 bit Ubuntu or other Linux and find USB transfers hang at the end apply this fix:

echo $((16*1024*1024)) > /proc/sys/vm/dirty_background_bytes
echo $((48*1024*1024)) > /proc/sys/vm/dirty_bytes

I suggest you edit your /etc/rc.local file to make this change persistant across reboots.

sudo nano /etc/rc.local

@aka-mj
aka-mj / unixsock_ex.go
Created February 9, 2017 19:32
Unix Socket Example in Go
package main
import (
"fmt"
"net"
"os"
"time"
)
func listen(end chan<- bool) {
@CMCDragonkai
CMCDragonkai / memory_layout.md
Last active October 11, 2025 12:39
Linux: Understanding the Memory Layout of Linux Executables

Understanding the Memory Layout of Linux Executables

Required tools for playing around with memory:

  • hexdump
  • objdump
  • readelf
  • xxd
  • gcore