Skip to content

Instantly share code, notes, and snippets.

@sidmulajkar
sidmulajkar / wireguard-issue-connecting.md
Created October 10, 2022 18:18
/usr/bin/wg-quick: line 32: resolvconf: command not found

/usr/bin/wg-quick: line 32: resolvconf: command not found

This issue is caused while using the Wireguard in Ubuntu as the installation doesn't come with resolvconf or openresolv

Problem

sid@sid:~$ sudo wg-quick up /etc/wireguard/abc.conf
[sudo] password for sid: 
[#] ip link add abc type wireguard
[#] wg setconf abc /dev/fd/63
@nitred
nitred / optimal_mtu.md
Last active December 11, 2025 08:56
Wireguard Optimal MTU

About

  • I faced bandwidth issues between a WG Peer and a WG server. Download bandwidth when downloading from WG Server to WG peer was reduced significantly and upload bandwidth was practically non existent.
  • I found a few reddit posts that said that we need to choose the right MTU. So I wrote a script to find an optimal MTU.
  • Ideally I would have liked to have run all possible MTU configurations for both WG Server and WG Peer but for simplicity I choose to fix the WG Server to the original 1420 MTU and tried all MTUs from 1280 to 1500 for the WG Peer.

Testing

  • On WG server, I started an iperf3 server
  • On WG peer, I wrote a script that does the following:
    • wg-quick down wg0
  • Edit MTU in the /etc/wireguard/wg0.conf file
@mdPlusPlus
mdPlusPlus / badblocks.txt
Last active July 6, 2025 15:40
How to check new hard drives with badblocks
badblocks -b 4096 -p 0 -s -t 0 -v -w DEVICE [LAST_BLOCK] [FIRST_BLOCK]
-b block_size
-p num_passes
-s Show the progress of the scan
-t test_pattern
-v Verbose mode
-w Use write-mode test
@masemoel
masemoel / BuildGuide.txt
Last active November 9, 2025 12:07
How to build an A14+ ROM from scratch under Ubuntu 24.04 (or based)
To build a A14+ (AOSP/LOS based) on Ubuntu 24.04+ (or distros based on it), there are four main steps:
(This guide is applicable for recoveries as well (TWRP, OFRP...))
Working on Android 14 and upper
#################################################################
# Step 1: Setup your environment #
#################################################################
****Setup Linux to build Android****
@gargomoma
gargomoma / gDriveLib.py
Last active May 5, 2020 08:35
A simple Python Class to handle basic interactions with GDrive (APIv3).
#Based on: https://github.com/samlopezf/google-drive-api-tutorial/blob/master/google-drive-api-tutorial-project/main.py
from __future__ import print_function
import os, io
import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from apiclient.http import MediaFileUpload, MediaIoBaseDownload
@samanshahmohamadi
samanshahmohamadi / MappingTest.sol
Created January 15, 2019 09:40
How to return whole mapping in solidity
pragma solidity ^0.4.25;
contract MappingTest {
mapping(uint=>address) public addresses;
uint addressRegistryCount;
function set(address userAddress) public{
addresses[addressRegistryCount] = userAddress;
addressRegistryCount++;
}
@joepie91
joepie91 / vpn.md
Last active December 8, 2025 03:34
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@kimondo
kimondo / Raspberry Pi Pi-Lite web counter
Created November 19, 2013 23:09
Raspberry Pi Pi-Lite web counter - grabs some stats off the wordpress stats API and then sends them to the serial port to be picked up by an arduino based LED display (ciseco.co.uk Pi-Lite or wharfe-education.com BelleVue)
import serial
import time
import urllib2
from BeautifulSoup import BeautifulSoup
# Configure Pi serial port
s = serial.Serial()
s.baudrate = 9600
s.timeout = 0
@dankrause
dankrause / ssdp.py
Last active August 29, 2025 01:12
Tiny python SSDP discovery library with no external dependencies
# Copyright 2014 Dan Krause
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,