Skip to content

Instantly share code, notes, and snippets.

@xorphitus
xorphitus / PKGBUILD
Created January 4, 2024 04:14
influxctl PKGBUILD
pkgname=influxctl
pkgver=2.4.2
pkgrel=1
pkgdesc="Command line interface writes to, queries, and performs administrative tasks in an InfluxDB Cloud Dedicated cluster."
arch=('x86_64' 'arm64')
url="https://docs.influxdata.com/influxdb/cloud-dedicated/reference/cli/influxctl/"
source_x86_64=("https://dl.influxdata.com/influxctl/releases/influxctl-v${pkgver}-linux-${arch}.tar.gz")
source_arm64=("https://dl.influxdata.com/influxctl/releases/influxctl-v${pkgver}-linux-${arch}.tar.gz")
sha512sums_x86_64=('d4c8dc03daae2b8f3ec8d54ef5ca58b127fcadd3bb16f56ce6b71ac3e6ceea6231268f01ffff411db284953d15e989f8016f22fa9d8f557f53a29fce6417d1f1')
sha512sums_arm_64=('59df3469f223aa8fc8002f52fbf7a9efadffe5e9721ba0389ec439c44f765bff5e4b09b3b868656ae4375f7d9cc34e9bf70c33ed80aef426758457232b17afb3')

Keybase proof

I hereby claim:

  • I am xorphitus on github.
  • I am xorphitus (https://keybase.io/xorphitus) on keybase.
  • I have a public key ASDn7CCjMVRKq4oZ_O3jZDMTC5bvDz8scxzlalIRHYMRewo

To claim this, I am signing this object:

@xorphitus
xorphitus / org-analyzer-for-remote.sh
Created February 18, 2020 09:02
Use org-analyzer for remote org files
#!/bin/sh
remote_host=hogehoge
org_path=/tmp/remote_org_files
rm -rf "$org_path"
mkdir -p "$org_path"
scp -r "${remote_host}:~/Documents/org" "$org_path"
elisp_dir=$(find ~/.emacs.d/elpa -maxdepth 1 -name 'org-analyzer-*' -type d)
jar="${elisp_dir}/org-analyzer.jar"
@xorphitus
xorphitus / emacsclient.fish
Last active October 23, 2019 15:55
extended Emacsclient
# This is 'fish' shell script
# You have to port if you use another shell (bash, zsh...)
#
# This file contains two functions
# Usage:
# Open file:
# $ e $HOME/.gitconfig
#
# Redirect stdout:
@xorphitus
xorphitus / sideeffect.py
Last active November 28, 2018 09:28
Python のリスト内包記法で副作用(具体的に言うと計算結果のキャッシュ)を起こしながらリストを作る方法
# 関数禁止とのことなので
# 普通にやった場合
# 例として文字列を単に2倍にするmap操作
[i * 2 for i in ['a', 'b', 'c', 'a', 'b']]
# 副作用ありの場合
# memoize用の変数を外出しにしていいかは謎
memo = {}
# memoize用変数に値があればそれを出す、なければ値をセットする
@xorphitus
xorphitus / template.sh
Last active July 20, 2018 04:07
shell scripte template
#!/bin/bash
#
# TODO: write documents
#
# Style Guide:
# https://google.github.io/styleguide/shell.xml
#
# Linter:
# https://www.shellcheck.net/
@xorphitus
xorphitus / remote_branches.sh
Created February 3, 2017 02:22
Gitのリモートブランチを、最終コミットの authror、comment と共に表示することで削除対象を発見しやすくする
for i in $(git branch -a | grep origin | grep -v '/HEAD' | grep -v '/master' | sed -e 's/->.*//'); do echo -n $(echo $i | sed -e 's/remotes\/origin\///') '- '; git log --oneline --pretty=format:"[%an] %s" $i | head -n 1; done
@xorphitus
xorphitus / algorithms.clj
Last active January 21, 2017 12:14
Clojureで基本アルゴリズムを実装
;;; バブルソート
;;; もっと綺麗に書けそうだが
(defn- switch-2 [a]
(if (< (count a) 2)
a
(let [[pre post] (split-at 2 a)]
(let [fst (first pre)
lst (last pre)]
(if (< fst lst)
@xorphitus
xorphitus / sexp.hs
Created September 13, 2016 15:44
HaskellでS式
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
import Data.List
import Data.ByteString.Lazy.Char8 (ByteString)
import qualified Data.ByteString.Lazy.Char8 as BL
data Sexp = List [Sexp] | Atom ByteString | Symbol ByteString deriving (Show, Eq)
toAtom :: (Show a) => a -> Sexp
toAtom = Atom . BL.pack . show
@xorphitus
xorphitus / scraping.clj
Created January 30, 2015 06:18
clojure, enlive でスクレイピング
(ns clj-scraping.core
(:require [net.cgrand.enlive-html :as en]
[clojure.java.io :as io]))
(def path "/http-path/")
(defn to-ids [url]
(-> (io/reader url)
en/html-resource
(en/select [:div.mainBox :div.searchResultBox :h2.clearfix :a])