Skip to content

Instantly share code, notes, and snippets.

View LeisureLinux's full-sized avatar

Leisure Linux LeisureLinux

  • Shanghai, China
View GitHub Profile
@LeisureLinux
LeisureLinux / adhole.status
Created April 22, 2023 04:53
adhole status
# =========================================
# LeisureLinux Adhole block domains sources
# UpdateTime: 2023-04-22T12:52:14+0800
# =========================================
#
URL: https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.2o7Net/hosts
# No head from source
Info: Blocked 2030 domains
URL: https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Risk/hosts
@LeisureLinux
LeisureLinux / convertPDF.sh
Created January 9, 2023 14:00
批量转换 PDF 文件添加水印
#!/bin/sh
# 批量转换 PDF 文件添加水印
# Github & Bilibili ID: LeisureLinux
# 1. 转换 jpg 格式的水印图片为 PDF
# $ convert watermark.jpg watermark.pdf
# convert 命令来自 ImageMagic 软件包
# 如果报错需要修改 policy 文件如下:
# $ sed -i '/disable ghostscript format types/,+6d' /etc/ImageMagick-6/policy.xml
# 2. 用 Gnumeric 软件包随带的 ssconvert 命令,可以批量把 Excel 转换为 PDF
# 例如: $ ssconvert all_obes_orders.xlsx -S all_obes_%s.pdf
@LeisureLinux
LeisureLinux / vagrant-cheat-sheet.md
Created December 19, 2021 14:02 — forked from wpscholar/vagrant-cheat-sheet.md
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@LeisureLinux
LeisureLinux / LeisureLinux.vimrc
Last active November 5, 2021 16:52
LeisureLinux vimrc
" ****************************************************************
" * LeisureLinux [In both BiliBili ID & WeChat ID] Vim Notes *
" * -- Copyright or Copyleft, that is a question. *
" * -- 2021.11.02, Shanghai, China *
" ****************************************************************
"
" 为更好的让初学者用好 Vim 插件 ,特别加注释,一个文档全搞定
" If nvim, put below three lines into ~/.config/nvim/init.vim
" set runtimepath^=~/.vim runtimepath+=~/.vim/after
" let &packpath = &runtimepath
@LeisureLinux
LeisureLinux / README.md
Created October 8, 2019 01:20 — forked from chuangbo/README.md
Python dynamic DNSPod DNS Script

替换上你的 API Token,域名ID,记录ID等参数,就可以运行了。 会在后台一直运行,每隔30秒检查一遍IP,如果修改了就更新IP。

获取 API Token 的方式

获得 domain_id 可以用 curl

curl -k https://dnsapi.cn/Domain.List -d "login_token=TOKEN"`
@LeisureLinux
LeisureLinux / godaddydns.sh
Created October 8, 2019 01:20 — forked from jgamblin/godaddydns.sh
Shell Script To Automatically Create A DNS A Record in Godaddy.
#!/bin/bash
DOMAIN=jgamblin.com
RECORD_NAME=newproject
GODADDY_API_KEY=(Get from devloper.godaddy.com)
GODADDY_API_SECRET=(Get from devloper.godaddy.com)
# Get IP Address
IP=`dig +short myip.opendns.com @resolver1.opendns.com`
# Create DNS A Record