Skip to content

Instantly share code, notes, and snippets.

@gali1
gali1 / proxy.pac
Created January 30, 2024 10:20 — forked from swinton/proxy.pac
Example proxy.pac, using a SOCKS proxy for certain hosts.
function FindProxyForURL(url, host) {
var useSocks = ["imgur.com"];
for (var i= 0; i < useSocks.length; i++) {
if (shExpMatch(host, useSocks[i])) {
return "SOCKS localhost:9999";
}
}
return "DIRECT";
@gali1
gali1 / make_openssl.txt
Created January 24, 2024 19:36 — forked from arawako/make_openssl.txt
Steps for compiling openssl in debian buster, testing and creating a .deb package using checkinstall
## Prepare the system
touch /etc/apt/sources.list.d/backports.list
echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list.d/backports.list
apt update && apt -y upgrade && apt install -y build-essential git checkinstall
# Clone the Source
git clone https://github.com/openssl/openssl.git
# Compile, test and install manually
cd openssl
@gali1
gali1 / History|-34bc2675|entries.json
Last active January 23, 2024 20:02 — forked from midoriiro/qt_rasp-pi3_cross_compile.md
Cross-compile Qt-5.11.3 from Linux to Raspberry PI 3 B+
{"version":1,"resource":"file:///home/user/Documents/pi-v4/home/pi/.bashrc","entries":[{"id":"QPdZ","timestamp":1698983018205}]}
@gali1
gali1 / golang-tls.md
Created October 28, 2023 11:47 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@gali1
gali1 / sources.list
Created October 7, 2023 03:55 — forked from piotrMocz/sources.list
/etc/apt/sources.list file for arm cross-compilation under amd64
# sources.list file for arm cross-development under amd64
#deb [arch=amd64] cdrom:[Ubuntu 14.04.3 LTS _Trusty Tahr_ - Beta amd64 (20150805)]/ trusty main restricted
deb [arch=armhf] http://ports.ubuntu.com/ trusty main restricted universe multiverse
deb [arch=armhf] http://ports.ubuntu.com/ trusty-security main restricted universe multiverse
deb [arch=armhf] http://ports.ubuntu.com/ trusty-updates main restricted universe multiverse
deb [arch=armhf] http://ports.ubuntu.com/ trusty-backports main restricted universe multiverse
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
@gali1
gali1 / proxy.md
Created October 6, 2023 17:25 — forked from yougg/proxy.md
complete ways to set http/socks/ssh proxy environment variables

set http or socks proxy environment variables

# set http proxy
export http_proxy=http://PROXYHOST:PROXYPORT

# set http proxy with user and password
export http_proxy=http://USERNAME:PASSWORD@PROXYHOST:PROXYPORT

# set http proxy with user and password (with special characters)
@gali1
gali1 / safe_dd.sh
Created October 6, 2023 11:16 — forked from AndreiCherniaev/safe_dd.sh
safe dd check does usb drive size == 32GB and after dd .img
# never use this if you have 32 GB hard drive
# never use this if you mount 2 or more 32GB usb flash card in one time
varvar=`blockdev --getsize64 /dev/sda`
# 32GB == 30765219840
if [ $varvar -eq 30765219840 ]; then
dd if=disk.img of=/dev/sda bs=4M conv=fsync status=progress
fi
#!/bin/bash
sudo fdisk -lu /dev/sdb
# Disk /dev/sdb: 14.9Gib, 1593153946 bytes, 31116288 sectors
# Units: sectors of 1 * 512 = 512 bytes
# Secor size (logical/physical): 512 bytes / 512 bytes
# I/O size (minimum/optimal): 512 bytes / 512 bytes
# Disklabel type: dos
# Disk identifier: 0x9c4e41cd
@gali1
gali1 / fetch-results.sh
Created August 28, 2023 04:46 — forked from sdstrowes/fetch-results.sh
id.server quad9
#!/usr/bin/env python
from ripe.atlas.cousteau import (
AtlasResultsRequest
)
import bz2
import json
import requests
import sys
@gali1
gali1 / enable-all-advanced-power-settings.ps1
Created August 19, 2023 16:52 — forked from raspi/enable-all-advanced-power-settings.ps1
Enable all advanced power settings in Windows.
# List all possible power config GUIDs in Windows
# Run: this-script.ps1 | Out-File powercfg.ps1
# Then edit and run powercfg.ps1
# (c) Pekka "raspi" Järvinen 2017
$powerSettingTable = Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSetting
$powerSettingInSubgroubTable = Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSettingInSubgroup
Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSettingCapabilities | ForEach-Object {
$tmp = $_.ManagedElement