Skip to content

Instantly share code, notes, and snippets.

View sursir's full-sized avatar
💥
COME BACK

Heisenberg sursir

💥
COME BACK
View GitHub Profile
@sursir
sursir / install.sh
Created May 18, 2022 05:45 — forked from rjnienaber/install.sh
Compile ImageMagick with WEBP and HEIC support on Ubuntu 16.04
# $ lsb_release -a
# No LSB modules are available.
# Distributor ID: Ubuntu
# Description: Ubuntu 16.04.5 LTS
# Release: 16.04
# Codename: xenial
# $ uname -a
# Linux xps 4.4.0-134-generic #160-Ubuntu SMP Wed Aug 15 14:58:00 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Download CMake from: https://cmake.org/download/

wget https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz

Compile from source and install

tar zxvf cmake-3.*
sun.hac.lp1.d4c.nintendo.net
beach.hac.lp1.eshop.nintendo.net
aauth-lp1.ndas.srv.nintendo.net
accounts.nintendo.com
api.accounts.nintendo.com
app-a04.lp1.npns.srv.nintendo.net
aqua.hac.lp1.d4c.nintendo.net
atum.hac.lp1.d4c.nintendo.net
bcat-data-lp1.cdn.nintendo.net
bcat-list-lp1.cdn.nintendo.net
@sursir
sursir / in.fourplex.aria2.plist
Created August 24, 2020 07:49 — forked from hewigovens/in.fourplex.aria2.plist
aria2 auto launch plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>in.fourplex.aria2</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/aria2c</string>
@sursir
sursir / .inputrc
Created April 12, 2019 15:54 — forked from shellexy/.inputrc
把这个文件保存为 ~/.inputrc 就能直接上下方向键搜索历史记录了。还能随时 cat ~/.inputrc 一下查看 shell 快捷键备忘
## history search
"\e[A": history-search-backward
"\e[B": history-search-forward
## visible ring
set visible-stats on
## menu complete
"\C-n": menu-complete
## 快捷键备忘
## Ctrl + a : 光标移到行首。
@sursir
sursir / smth.js
Created February 27, 2019 09:55 — forked from coderLMN/smth.js
本段代码用于从水木社区二站( 2.newsmth.net) 的公开版面抓取所有帖子。具体用法是:先用浏览器打开要抓取的版面(例如 C.abc)并转到第一页的帖子列表,然后在控制台运行下列代码,再手工点击第一个帖子,然后程序就会按顺序逐个打开帖子,并将其内容存入 page 字符串,在浏览完成后,控制台会输出 page 字符串,把它复制粘贴保存为一个 .html 文件,打开就是该版面的所有帖子了。同时,浏览帖子的那个 iframe 里也会显示抓取到的所有帖子内容。【注意】此工具没有在一站测试过,它只是作为动态加载 iFrame 并提取其中 DOM 节点方法的代码演示,使用者请注意谨慎使用,切勿违反有关法律法规。
var iframe = document.getElementsByName('f3')[0]; //获取显示帖子内容的 iframe
//初始化抓取结果,它是一个 HTML 页面,因此先把头部以及简单的几个样式放进去
var page = '<!DOCTYPE html><html><head><title>SMTH</title><style>div {border-top: 1px solid yellowgreen; padding: 10px; color: royalblue;}</style></head><body>';
//点击打开第一个帖子就可以激活下面的函数执行
iframe.onload = function(){
var innerDoc = iframe.contentDocument || iframe.contentWindow.document; //获取 iframe 里的 document 对象
var post = innerDoc.getElementsByClassName('article')[0].innerHTML; //获取帖子内容对应的 HTML 元素
page += '<div>'+post.replace(/src="/g, 'src="http://www.2.newsmth.net/')+'</div>'; //把当前的帖子内容加入抓取结果的 HTML 页面里
var next = innerDoc.getElementsByClassName('conPager smaller right')[0].children[1].href; //获取下一个帖子的链接地址
if(iframe.src != next) { //判断是否抓取完成
@sursir
sursir / bulk_rejections.md
Created December 7, 2018 04:02 — forked from cdahlqvist/bulk_rejections.md
rally-bulk-rejections-track

Bulk Rejections Test

This Rally track is used to test the relationship between bulk indexing rejections and the following parameters:

  • Number of concurrent clients indexing into Elasticsearch
  • Number of shards actively being indexed into
  • Number of data nodes in the cluster
  • Size of bulk requests

The track contains a number of challenges, each indexing into an index with a set number of shards using a increasing number of concurrent client connections and two different bulk sizes.

@sursir
sursir / shadowsocksR.sh
Last active January 28, 2019 05:25 — forked from chenjie/shadowsocksR.sh
Shadowsocks(R) setup script backup. shadowsocks shadowsocksr ss ssr
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#=================================================================#
# System Required: CentOS 6,7, Debian, Ubuntu #
# Description: One click Install ShadowsocksR Server #
# Author: Teddysun <[email protected]> #
# Thanks: @breakwa11 <https://twitter.com/breakwa11> #
# Intro: https://shadowsocks.be/9.html #
#=================================================================#
@sursir
sursir / example.sh
Created November 7, 2018 09:47 — forked from jpotts/example.sh
Need a better approach to sorting semantic version strings in Elasticsearch
# Delete the example index
curl -XDELETE "http://localhost:9200/sortable-version-test?pretty=true"
# Create a new example index
curl -X POST "http://localhost:9200/sortable-version-test?pretty=true"
# Set the mapping. Assumes version.groovy resides in $ES_HOME/config/scripts
curl -XPOST "http://localhost:9200/sortable-version-test/version/_mapping?pretty=true" -d'
{
"version": {
@sursir
sursir / gist:73a3b3d8d9e22f81b21ac5bfce910b85
Last active October 8, 2018 09:30 — forked from avoine/gist:2912777
Bridge to send rsyslog logs to sentry (http://www.getsentry.com)
#!/usr/bin/env python
#
# Copyright 2012 Patrick Hetu <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,