Skip to content

Instantly share code, notes, and snippets.

@olbat
olbat / synology-blocklist-update
Last active August 16, 2023 11:05
Synology DonwloadStation blocklist update script
#!/bin/bash
set -euo pipefail
BLOCKLIST_URL='https://list.iblocklist.com/?list=bt_level1&fileformat=p2p&archiveformat=gz'
BLOCKLIST_FILE=/var/packages/DownloadStation/etc/download/blocklists/level1
echo "Clean old blocklist"
rm -f $(dirname $BLOCKLIST_FILE)/*
echo "Download new blocklist"
@hazcod
hazcod / wgcf.sh
Created October 16, 2019 06:10
Connect to Cloudflare Warp from macOS.
#!/usr/bin/env bash
set -euo pipefail
shopt -s inherit_errexit 2>/dev/null || true
# this script will connect macOS to Cloudflare Warp using Wireguard
# note: this is *absolutely not* an official client from Cloudflare
# Copyright (C) 2019 Jay Freeman (saurik)
# Zero Clause BSD license {{{
@wancw
wancw / 0 - Readme.md
Last active July 4, 2023 09:34
移除 macOS 健保卡元件

檔案說明

  • removeNHIICC.sh : 移除健保卡元件與相關設定,須以 root (sudo) 權限執行。
  • postinstall.sh : 官方「MAC 元件移除安裝檔」的 script 內容(2020)
@bgauduch
bgauduch / multiple-repository-and-identities-git-configuration.md
Last active November 13, 2024 03:35
Git config with multiple identities and multiple repositories

Setup multiple git identities & git user informations

/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉

Setup multiple git ssh identities for git

  • Generate your SSH keys as per your git provider documentation.
  • Add each public SSH keys to your git providers acounts.
  • In your ~/.ssh/config, set each ssh key for each repository as in this exemple:
@hjertnes
hjertnes / doom.txt
Created April 6, 2018 08:28
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
@ntrepid8
ntrepid8 / tar_xz_tips.md
Last active July 4, 2024 09:26
Create tar.xz file with threads and progress bar

tar xz tips

Compress a directory using multiple threads and show a progress bar with this script:

#!/usr/bin/env bash

# example: tar_cJf.sh ./directory > directory.tar.xz

SOURCE="$1"
@patrobinson
patrobinson / .bash_profile
Last active September 26, 2018 00:51
Using yubikey 4c on Mac OS X (running Sierra)
GPG_ENV=$( gpg-agent --daemon 2>/dev/null )
if [ $? == 0 ]; then
eval $GPG_ENV
else
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
fi
export GPG_TTY=$(tty)
function copy-code() {
echo $1 |sed -e 's/[^ ]* //' |pbcopy
@gregwym
gregwym / blocklists.synology.sh
Created July 28, 2017 06:18
Enable and update blocklists for Synology Download Station
#!/bin/sh
# Script for blocking IP's
# Set path
cd /var/packages/DownloadStation/etc/download/blocklists
# Permissions
chmod 777 ../settings.json
# Edit config file (block)

WannaCry|WannaDecrypt0r NSA-Cyberweapon-Powered Ransomware Worm

  • Virus Name: WannaCrypt, WannaCry, WanaCrypt0r, WCrypt, WCRY
  • Vector: All Windows versions before Windows 10 are vulnerable if not patched for MS-17-010. It uses EternalBlue MS17-010 to propagate.
  • Ransom: between $300 to $600. There is code to 'rm' (delete) files in the virus. Seems to reset if the virus crashes.
  • Backdooring: The worm loops through every RDP session on a system to run the ransomware as that user. It also installs the DOUBLEPULSAR backdoor. It corrupts shadow volumes to make recovery harder. (source: malwarebytes)
  • Kill switch: If the website www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com is up the virus exits instead of infecting the host. (source: malwarebytes). This domain has been sinkholed, stopping the spread of the worm. Will not work if proxied (source).

update: A minor variant of the viru

@wbotelhos
wbotelhos / clear-sidekiq-jobs.sh
Last active October 23, 2024 14:10
Clear Sidekiq Jobs
require 'sidekiq/api'
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear