Skip to content

Instantly share code, notes, and snippets.

View palemoky's full-sized avatar
🤔
Make thinking a habit

Palemoky palemoky

🤔
Make thinking a habit
  • Beijing, China
View GitHub Profile
@palemoky
palemoky / hackernews.md
Last active January 26, 2026 22:00
Hacker News Best Stories Mirror
@palemoky
palemoky / synology_login_background.php
Created July 9, 2020 15:12
Synology login page automatically replaces bing wallpaper
<?php
// 获取图片信息
$img_info = file_get_contents('https://cn.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&pid=hp&FORM=BEHPTB&video=1');
// 请求失败时,使用「Server 酱」将错误信息推送至绑定的微信
if (false === $img_info) {
file_get_contents('https://sc.ftqq.com/xxx.send?text=' . urlencode('Get bing wallpaper error!'));
}
$img_obj = json_decode($img_info)->images[0];
@palemoky
palemoky / synology_login_background.sh
Last active July 9, 2020 15:13
Synology login page automatically replaces bing wallpaper
#!/bin/bash
# Author: Palemoky
# Fetch image
img=$(curl -s 'https://bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&pid=hp&FORM=BEHPTB&video=1')
img_path=$(jq .images[0].url <<< $img)
img_name=$(jq .images[0].urlbase <<< $img)
img_name=${img_name#*=}
@palemoky
palemoky / bing_wallpaper.sh
Created July 8, 2020 05:05
Get bing wallpaper via proxy
#!/bin/bash
# Author: Palemoky
# Change directory to work path
cd /path/to/work
pages=$(curl -sG --data-urlencode "country=美国" 'https://ip.jiangxianli.com/api/proxy_ips' | jq .data.last_page)
for page in $(eval echo {1..${pages}}); do
@palemoky
palemoky / cloudflare_ddns.sh
Last active July 8, 2020 05:08
Cloudflare DDNS
#!/bin/bash
# Author: Palemoky
email=
domain=
api_token=
dns_identifier=
zone_identifier=