Skip to content

Instantly share code, notes, and snippets.

View RecoFu's full-sized avatar

Reco RecoFu

View GitHub Profile
@scturtle
scturtle / feedly.py
Last active March 9, 2022 00:13
python scripts for feedly
import re
import json
import requests
URL_TO_SAVE = ('https://feedly.com/v3/streams/contents?'
'streamId=user%2F{}%2Ftag%2Fglobal.saved&count=100')
HEADERS = dict(l.strip().split(': ') for l in open('headers.txt').readlines()
if len(l.strip()))
USERID = re.search(r'"feedlyId":"([^"]+)"', HEADERS['Cookie']).group(1)
@tylerni7
tylerni7 / rant
Created July 22, 2014 16:55
Rant on 0day sales
I don't think people understand what vulnerability sellers really do. They invest thousands of man and computer hours into finding bugs which people are willing to pay lots of money for. As a business, they want to keep their customer base happy, which means allowing their customers (yes, presumably the NSA/FBI/etc.) to use their exploits rather than selling them to Tails OS maintainers. Yes, it's probably the case that these exploits don't just go to nabbing child pornographers or drug traffickers, they also probably try to catch the next Snowden, which not everyone agrees is The Right Thing To Do. But for what it's worth, I'd still trust the US government (even with all its faults) far more than the Russians or Chinese.
But let's be honest here, Tails OS maintainers probably couldn't afford the same price that Exodus's customers will happily pay. Even if Exodus were happy to sell it to the Tails folks, that is certainly going to be a loss of money.
The arguments I'm used to hearing go something like "but
@dstreefkerk
dstreefkerk / Schedule-ChocoUpgradeAll.ps1
Last active March 8, 2022 20:52
PowerShell script to create a scheduled task that runs a choco upgrade all at machine startup
# See if choco.exe is available. If not, stop execution
$chocoCmd = Get-Command -Name 'choco' -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Select-Object -ExpandProperty Source
if ($chocoCmd -eq $null) { break }
# Settings for the scheduled task
$taskAction = New-ScheduledTaskAction –Execute $chocoCmd -Argument 'upgrade all -y'
$taskTrigger = New-ScheduledTaskTrigger -AtStartup
$taskUserPrincipal = New-ScheduledTaskPrincipal -UserId 'SYSTEM'
$taskSettings = New-ScheduledTaskSettingsSet -Compatibility Win8
@TerAnYu
TerAnYu / upgrade-all-packages
Created November 18, 2017 17:25 — forked from danielvijge/upgrade-all-packages
Upgrade all packages on OpenWRT router
#!/bin/ash
echo "Updating package list..."
opkg update > /dev/null
if [ `opkg list-upgradable | cut -d " " -f1 | wc -l` -gt 0 ]; then
echo "Available updates:"
opkg list-upgradable
echo ""
@sebsto
sebsto / gist:6441df09e97c4cbbd22b8ba313b8d642
Last active July 19, 2022 03:26
Amazon Linux 2 first boot on Virtual Box
# Download the VDI from https://cdn.amazonlinux.com/os-images/latest/
# Doc is at http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-linux-2-virtual-machine.html
# Be sure you have config/meta-data and config/user-data ready as per the below
# change ec2-user's password to your password
$ cat config/meta-data
local-hostname: amazonlinux.onprem
# eth0 is the default network interface enabled in the image. You can configure
@nicman23
nicman23 / upgrade
Created April 21, 2018 06:34
Openwrt upgrade script
#!/bin/sh /etc/rc.common
START=99
USE_PROCD=1
start_service() {
if [ -e /root/.upgrade ]
then exit
else touch /root/.upgrade
fi
@AveYo
AveYo / .. MediaCreationTool.bat ..md
Last active October 24, 2025 11:14
Universal MediaCreationTool wrapper for all MCT Windows 10 versions - MOVED TO github.com/AveYo/MediaCreationTool.bat
@ycku
ycku / apt-offline.md
Last active April 22, 2025 06:48
記錄 apt-offline 的標準語法,在離線環境使用 apt

Advantages

  1. 相容原有的 source list
  2. 只下載需要安裝的套件
  3. 步驟單純

Goals

基本上就是處理下面三種(apt update, upgrade, install)需要網路的操作

  • online$: 表示在有對外網路的主機操作
  • offline$: 表示在無對外網路的主機操作
@Cojad
Cojad / mini_google_authenticator.php
Last active May 21, 2025 10:01
Very small implementation of Google's OTP Authenticator
<?php
// copied from python code at https://stackoverflow.com/a/23221582/3103058
function base32_decode($key) {
// https://www.php.net/manual/en/function.base-convert.php#122221
$key = strtoupper($key);
list($t, $b, $r) = array("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", "", "");
foreach(str_split($key) as $c)
$b = $b . sprintf("%05b", strpos($t, $c));
foreach(str_split($b, 8) as $c)
$r = $r . chr(bindec($c));
@mingderwang
mingderwang / list.py
Created August 19, 2020 06:34
Python Taiwan (Telegram) 讀書會練習
'''
https://note.nkmk.me/en/python-function-return-multiple-values/
我們用 function 可以一次回傳多個值, 當成了解 list 與 tuple 不同的地方
'''
# list 數學叫 "陣列", 其特性是 一堆有 “順序” 關係的東西清單.
# 這些東西, 未必要同一型態, 但同一型態 的 list 比較合理(且常用)
'''