Skip to content

Instantly share code, notes, and snippets.

@thoughtsunificator
thoughtsunificator / README.md
Last active April 26, 2024 22:03
Setup a native proxy switcher on Firefox
  • Download script.pac to /home/user/script.pac
  • Go to FF network settings and select 'Automatic proxy configuration URL'
  • Enter file:///home/user/script.pac
  • Enjoy

Note: If you're using SOCKS v5 you might want to also select 'Proxy DNS when using SOCKS v5'

Tested on 116.0.2 (64 bit) Arch Linux

@rikka0w0
rikka0w0 / ft2232_to_digilent_jtag.md
Last active July 16, 2024 10:05
FT2232 to Digilent JTag for Xilinx FPGAs (ISE/Vivado)

The Digilent JTag uses FT2232, but its configuration EEPROM contains secrete data needed to be recoginzed by Xilinx ISE/Vivado. The following method only works on linux (tested on Ubuntu16.04), but the patched FT2232 doggle also works on Windows. Since WSL1 does not provide USB device access, the following method will not work for WSL1.

DONT use FT_Prog on offical Digilent cable, as it can trash the firmware! The offical eeprom contains secrete data that cannot be handled correctly by FT_Prog.

Here are steps to create a Digilent-like Jtag that can be used in Xilinx ISE and Vivado

  1. Install softwares: sudo apt-get install libftdi1 ftdi-eeprom
  2. Create a file "flash_digilent.conf" with the following content:

 "картинка для привлечения внимания"

О специальной олимпиаде Haskell vs Python (pypy) vs всё остальное

Первоначально задача возникла в https://t.me/haskellru и формулировалась примерно так: почему следующий код на Haskell

@zmts
zmts / tokens.md
Last active July 22, 2024 18:25
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@coopernurse
coopernurse / howto
Last active August 29, 2015 13:57
the world's dumbest Haskell json-rpc example
cabal install scotty
cabal install aeson
runhaskell server.hs
curl -X POST -d '{"jsonrpc":"2.0", "method":"Calc.Add", "params":[10,50], "id":"abc"}' http://localhost:3000/api
@klkvsk
klkvsk / gist:9684458
Created March 21, 2014 11:45
extdoc.php - generate .php from extension
<?php
if ($argc < 2) {
die('Usage: php extdoc.php <extension_name>' . PHP_EOL);
}
$extension = $argv[1];
$keywords = array('__halt_compiler', 'abstract', 'and', 'array', 'as', 'break', 'callable', 'case', 'catch',
'class', 'clone', 'const', 'continue', 'declare', 'default', 'die', 'do', 'echo', 'else', 'elseif', 'empty',
'enddeclare', 'endfor', 'endforeach', 'endif', 'endswitch', 'endwhile', 'eval', 'exit', 'extends', 'final',
'for', 'foreach', 'function', 'global', 'goto', 'if', 'implements', 'include', 'include_once', 'instanceof',
@guewen
guewen / pg_on_ram.sh
Last active January 24, 2020 08:37
Create a PostgreSQL cluster in a ramfs and start the server on this cluster.
#!/bin/bash
PORT=6432
# Create a ramfs
if [ -f /tmp/pg_on_ram ]
then
echo "/tmp/pg_on_ram already exists"
exit 1
fi
@thefish
thefish / ddos-autoban.sh
Last active December 23, 2015 03:59
Autoban scripts for dumb DDoS (FreeBSD)
#!/bin/sh
while read count ip
do
test $count -gt 100 && echo " ipfw add deny all from $ip to me"
done
@thefish
thefish / utf8-win1251
Created May 21, 2013 08:31
JS utf-8 to windows-1251 string converter
//utf8 to 1251 converter (1 byte format, RU/EN support only + any other symbols) by drgluck
function utf8_decode (aa) {
var bb = '', c = 0;
for (var i = 0; i < aa.length; i++) {
c = aa.charCodeAt(i);
if (c > 127) {
if (c > 1024) {
if (c == 1025) {
c = 1016;
} else if (c == 1105) {
@agarzon
agarzon / dnsbl.sh
Last active October 2, 2022 09:04
DNS Black List - Linux shell script (improved from: http://www.daemonforums.org/showthread.php?t=302)
#!/bin/sh
# Check if an IP address is listed on one of the following blacklists
# The format is chosen to make it easy to add or delete
# The shell will strip multiple whitespace
BLISTS="
b.barracudacentral.org
bb.barracudacentral.org
bl.deadbeef.com
bl.mailspike.net