Selbstgesprächen

Iwein 1298f.

unz der man niht veige enist, sô nert in vil cleiner list.

なんか

ね、パーマリンクの設定が/%postname%/から/%category%/%postname%/にいつの間にか変わってた事に気づかなかった件。

Mastodonのインスタンスを無料で作ってみよう

最近、2020年6月30日に日本の大規模なmastodonインスタンス mstdn.jp と mastodon.cloud が閉鎖される事が発表されました。
そこで今回はOracle Cloud Free TierのOracle Cloud Infrastructure Compute VMを使って無料でmastodonインスタンスを建ててみようと思います。GCEのf1-micro一つでも快適さ度外視すれば動くらしいので、お一人様インスタンスでしたらこのOracleのVM使えばなんとか動くのではないでしょうか。知りませんけど

必ず公式のガイドMastodon – Installing from sourceを確認しながら作業を行なってください。

追記:
2021年6月頃に「VM.Standard.A1.Flex」が4vCPU, RAM24GBまで無料になりました。
このシェイプを使うとチューニング無しで非常に人権のあるお一人様インスタンスを作れるので、おすすめです。

続きを読む

boinccmd cpuの使用率を制限する

boincをそのまま動かすとCPUをマックスで使ってしまうので、使用率を制限したいときには
/etc/boinc-client/global_prefs_override.xmlに
max_ncpus_pctに任意の値をセットしてあげると制限ができます。

# 50%に制限
<global_preferences>
<max_ncpus_pct>50.0000</max_ncpus_pct>
</global_preferences>

# 75%に制限
<global_preferences>
<max_ncpus_pct>75.0000</max_ncpus_pct>
</global_preferences>

記述後はboinccmdで設定ファイルを読み直します。

$ sudo -u boinc boinccmd --read_global_prefs_override

GCE f1-microで課金?

2019/03/29追記

いつの間にか若干Always freeの内容が変わっていてf1-microが無料で使えるリージョンが3箇所のみになってました。
us-west1 (Oregon), us-central1(Iowa), us-east1(South Carolina)です。

1 non-preemptible f1-micro VM instance per month in one of the following US regions:
Oregon: us-west1
Iowa: us-central1
South Carolina: us-east1
https://cloud.google.com/free/docs/gcp-free-tier

これのせいですね。


VPSに極力お金を使いたくない人の強い味方のGoogle Cloud PlatformのCompute Engine, f1-microさん。
f1-microはAlways free((Always Free, which provides limited access to many common GCP resources, free of charge.
https://cloud.google.com/free/docs/gcp-free-tier
))に毎月1ヶ月分無料の枠があります。
1つのインスタンスはただで使えるわけですね。嬉しいです!

おさらいですが、GCEのAlways freeは

1 f1-micro instance per month (US regions only – Excluding Northern Virginia [us-east4])

30 GB-months HDD, 5 GB-months snapshot

1 GB network egress from North America to all region destinations per month (excluding China and Australia)
https://cloud.google.com/free/

となっています。

しかし、久しぶりに「料金の履歴」を見てみると…

Compute Engine Micro Instance with burstable CPU running in Los Angeles: 151.138 時間 [通貨換算: USD から JPY(レート 109.43 を使用)]

はて、これは一体…?今までなかったぞ…(´・ω・`)

f1-microはus-east4のヴァージニアを除いた米国リージョンで無料のはずなんですが…
f1-microのインスタンスは一つしか立ってないし無料時間分を超えたとも思えない…

構成は、
us-west2, HDD 30GB, debian
と無料枠に収まっています。

不思議ですねえ。

一応Always freeの利用資格「Program eligibility」に
Have an account in good standing.
なんて文言があるので、もしかしたら何かに引っかかったんでしょうか。

しばらく様子見です。

TeXification failed with status code 1

Win10 x64, Atomで久しぶりにLaTexをコンパイルしようとすると

TeXification failed with status code 1

というエラー。
いろいろぐぐってみると

fmtutil-sys --all

を取り敢えず使ってみれば良かったぽいので試してみるとコンパイルが通った。

うーん、

GitHub Educationの資格を延長した

BitBucket派なので全然GitHubを使ってないんですが、GitHubから
[GitHub] Coupon expiration reminder
という件名のメールが来ており、
はて?
と思ってみたらどうにも二年前ぐらいにGitHub Educationに登録してたらしく、それの期限がそろそろ切れるよーっていうメールでした。

Hey there,

Thanks for using GitHub! A while ago you used a GitHub coupon that was good for $7.00 off 2 years of GitHub. This coupon will expire in 13 days (December 03, 2018).

If you are still a student or teacher, you may apply for a new academic discount coupon at https://education.github.com/discount_requests/new

We noticed you haven’t entered any payment information yet. If you’d like to continue using the plan you’re on (Developer – $7/month) you’ll need to add a valid payment method to your account. After your coupon expires, we’ll charge your account and you can keep using your plan without interruption.

https://github.com/account/billing – enter a payment method

If you don’t want to continue your current plan you can delete your private repositories and downgrade to a free plan.

We hope you’ve enjoyed trying out GitHub’s private features. Please let us know if you have any questions — reply to this email or contact support@github.com.

Thanks for being awesome,
The GitHub Team

あと13日で資格が終わるから、もしまだ学生か先生なんだったら申請してね。
ということです。
延長できるならしておこうと思い記載のURLから必要事項を入力し、申請をします。
3分でメールが届きました。

Powerup get! Welcome to the Student Developer Pack.

Hey xxxx xxxxx, we have some awesome news

We’ve upgraded you to a plan with unlimited free private repositories, which will be free for the next two years. After that, you’ll get an email saying that your coupon is expiring. You can reapply for another coupon if you still have academic status. We don’t have any collaboration limits, so any group projects you may encounter can be hosted via your account.

If you need help getting started with Git and GitHub, check out:

https://help.github.com/articles/good-resources-for-learning-git-and-github

We’ve also given you access to the Student Developer Pack, available at:

https://education.github.com/pack

If you have any questions, contact us:

https://education.github.com/contact

Spread the word: we love giving educational discounts to students, teachers, administrators, and researchers! Please send them to:

https://education.github.com

Have an Octotastic day!

– The GitHub Education Team

簡単ですね!

ちなみにDigital OceanのクーポンなどがもらえるStudent Developer Packに関しては更新されません。残念。

せっかくだからこの機会にGitHubを使ってみようと思ったり…

DebianにStrongHands wallet(Cli版)の導入と移行

導入環境

今回はGoogle Cloud Engineのf1-microインスタンス上でDebian 9 64bitを使用しました。
f1-microインスタンスは特定の条件下では無料で使用できるので、おすすめデス。
Google Cloud Platformの無料枠についてはGoogle Cloud Platform の無料枠のページに書いてます。
ただ、フリートライアルのアカウントでは仮想通貨のマイニングが明確に禁止されています。PoSマイニングが含まれているかどうかは知りませんが、フリートライアルのアカウントで試めそうとしている方はアカウントをアップグレードしておきましょう。

2. Limitations. During the Free Trial:

2.2 Customer may not use the Services to engage in mining cryptocurrency;

https://cloud.google.com/terms/free-trial/

makeに際してf1-microではメインメモリが512mbで足りないので、swapを有効にしておいて下さい。

walletの導入

まずは必要なパッケージをインストールしておきます。

$ sudo apt-get install ntp git build-essential libssl-dev libdb-dev\
 libdb++-dev libqrencode-dev libboost-dev qt5-default qt5-qmake libprotoc-dev libprotobuf-dev\
 libpng-dev qrencode libqrencode-dev qttools5-dev-tools libboost-all-dev libminiupnpc-dev -y
$ sudo apt-get install libssl1.0-dev -y

次に一応shnd専用ユーザーを作成しておきます。

$ sudo adduser --disabled-login --gecos 'SHND' shnd

shndユーザーに変えてgithubからwalletのソースコードを取ってきて、ビルドします。
f1-micro上でmakeすると時間が凄くかかるので高スペックのプリエンプティブインスタンスを立ててさくっとmakeしてから、できたものをf1-microに送るのがいいかもしれませんね。
n1-standard-4だとインスタンス立ててmake終了まで10分かかりません。

$ sudo su - shnd
$ git clone https://github.com/bumbacoin/stronghands.git shnd
$ cd shnd/src
$ make -f makefile.unix

今回makeしたのをとりあえず置いておきますね。
stronghandsd_builded_on_debian_9.rar PW:StrongHands
md5: 473bd34317580d741168c67df76fbc47

makeが終わったら同ディレクトリにstronghandsdが作成されたと思います。これがwallet本体になります。ホームディレクトリに移動させて一旦起動して設定フォルダを作成させます。

$ mv stronghandsd ~/
$ cd ~
$ ./stronghands

Ctrl+Cを押して一旦終了させます。

他walletからデータを移行

新しくwalletを作ってそこにshndを送金しては成熟期間が無駄になるのでdatファイルを使って移行してしまいます。
qt版のwalletを使ってる方はFile -> Backup Walletからwalletのバックアップdatを作成できます。

さっき一旦起動して終了させたことでホームディレクトリに.stronghandsという隠しフォルダができたと思います。
この中に入ってるwallet.datがwalletデータなので、さっきバックアップをとったdatファイルをこれにコピーします。

$ mv backup.dat .stronghands/wallet.dat

あとは

$ ./stronghandsd -daemon

これで放置するだけです!

Pos Mining

walletを起動させているだけではpos mimingは出来ません。
walletのunlockとgenerateをtrueにする必要があります。

$ ./stronghands walletpassphrase passphrase 1608201813
$ ./stronghands setgenerate true

とでもしておきましょう。

getmininginfoでgenerateがtrue, hashespersecが0以外ならOKです。

使いそうなオプション

使用しそうなstronghandsdのオプション項目を書いておきます。
https://pastebin.com/aehvg6GR

その他のオプションは
https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list
を参考にして下さい。

最後に

f1-microインスタンスだとメモリは余裕がありますがcpu使用率が100%近くに張り付くので、同インスタンスで別通貨のPoSマイニング等は厳しいですね。

[template id=”342″]

YiiMP.euでStratum authentication failed

YiiMP.euなどのworkerに自分のアドレスを指定してマイニングするタイプのプールで
“Stratum authentication failed”
と認証に失敗することがまれにあります。

私は複数枚のGPUでマイニングしているのですが、特定のGPUのみこのエラーに見舞われる謎の現象に陥りました。
再起動などを試しましたが一向に回復しません。
プールの状態が悪いのかと思い数時間置いてみましたが改善しません。
普段であればccminerやpcの再起動、若干時間を置くことによって改善します。
このGPUは若干リジェクト率が高かったのでBANされたのでしょうか。

そこで新しいアドレスを使用してマイニングしたところ無事に繋がり、その後すぐに元のアドレスに戻したら何事もなかったかのようにマイニングが始まりました。
何かフラグでも立っていて、別のアドレスでマイニングした事によりそのフラグが消えてできた…
のような感じでしょうか。
よくわかりませんが、とりあえずマイニング再開できてホッとしました。


投げ銭待ってます!
BTC : 17wbepoMVUW5D5Gvz8fDHLVXER9EXSEpdW
Mona : MUDq4ZNwdfhtYeprEbzoYGYpDM9Sagq7MV
ETH : 0xb756c28f3531a94651e47471740eac562e9f2e66
XVG : D5HSSkAX3C6ZPKKuXM3JfunbjNbTYkYmjM
TRX : 0xa759e111477ed0ab3d67fcd54e073566de1ee937