Debian

[Seravarica] Lobster Unlimited Expanding Storage Plan Benchmark


Servarica

  • Lobster Unlimited Expanding Storage Plan
  • vCPU : 4 Shared CPU Cores (AMD EPYC)
  • Memory : 3 GB
  • Storage : 1TB DISK (HDD – RaidZ2) with daily 3GB increase
  • Bandwidth : 100 Mbps unlimited or 1Gbps for first 6TB/mo. then 10 Mbps unlimited.
  • Pricing : 10 USD / mo.

毎日ストレージが3GBずつ増えていく不思議なプランです。
安いプランではShrimp1は5USD/mo.で1GB, Shrimp2は7USD/mo.で2GBずつ増えていくプランがあります。
ストレージに対して少し割高な気もしますが、VPS自体のスペックがまあまあいいので割に合わないということはないでしょう。

続きを読む

[Serversman@VPS] Debian 7から8へアップグレードする

Serversman@VPSでのDebian 7から8へのアップグレード方法をまとめた記事です。
シンプルプランで、初期から何もいじってない事を前提にしています。
このアップデートは公式からの保証(サポート)対象外になるので、バックアップをしっかり取って自己責任でお願いします。
(ここのVPSを改めて使う物好きな人は中々いないと思いますけども。)

続きを読む

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

[Raspberry pi] apt-fastの導入

apt-fastはaptを用いたパッケージのダウンロード時に並列ダウンロードを行い、高速化するソフトウェアです。
ダウンロードは速くなりますが、インストールが速くなるかといえばそうではないので、注意が必要です。

今回はなんとなくRaspberry pi (Raspbian)を対象にしていますが、Debian系でパッケージ管理にaptを用いていればその他でも使えます。

$ git clone https://github.com/ilikenwf/apt-fast.git
$ cd apt-fast
$ sudo bash quick-install.sh
---
$ apt-fast --version
apt 1.4.9 (armhf)
サポートされているモジュール:
*Ver: Standard .deb
*Pkg:  Debian dpkg interface (Priority 30)
 Pkg:  Debian APT solver interface (Priority -1000)
 Pkg:  Debian APT planner interface (Priority -1000)
 S.L: 'deb' Debian binary tree
 S.L: 'deb-src' Debian source tree
 Idx: Debian Source Index
 Idx: Debian Package Index
 Idx: Debian Translation Index
 Idx: Debian dpkg status file
 Idx: Debian deb file
 Idx: Debian dsc file
 Idx: Debian control file
 Idx: EDSP scenario file
 Idx: EIPP scenario file

[Debian] CoderでVS CodeなオンラインLaTeX環境を作る

オンラインでVisual Studio Codeが使用できるCoderが最近、OSS化しました。
そこでCode-serverを用いてVPS上に快適な個人LaTeXエディタの環境を整えることにしました。

備忘録です。

今回のVPSの環境は
・ASW – Lightsail 2GB
・Debian Stretch
です。

Coderの導入に関しては、正直バイナリファイルを落としてくるだけなので簡単です。
LaTeXの導入に若干の時間がかかります。

ただ問題点が、
・PDFのプレビューが見れない
・拡張機能のインストールと使用に若干の難がある
の2つがあります。
今後のアップデートに期待です。

続きを読む

WLinuxのapt updateが遅い

WLinux

$ sudo apt-get update

が異様に遅い。upgradeやinstallは速いんです。

普段はaptのリポジトリを変更しないのですが、updateがとんでもなく遅いので日本のサーバーに変更しました。

$ sudo vim /etc/apt/sources.list
# sources.list
deb http://cdn.debian.or.jp/debian testing main contrib non-free
# deb-src http://cdn.debian.or.jp/debian testing main

deb http://cdn.debian.or.jp/debian testing-updates main
# deb-src http://cdn.debian.or.jp/debian testing-updates main

deb https://deb.debian.org/debian-security testing/updates main
# deb-src http://cdn.debian.or.jp/debian-security testing/updates main

deb http://cdn.debian.or.jp/debian/ unstable main contrib non-free
# deb-src http://cdn.debian.or.jp/debian/ unstable main contrib non-free

deb http://apt.patrickwu.space/ stable main
# obtain source from http://github.com/wslutilities/wslu

$ sudo vim /etc/apt/sources.list.d/stretch-backports.list
# stretch-backports.list
deb http://cdn.debian.or.jp/debian stretch-backports main

これでストレスフリーです・ω・

debianのミラーサーバーはhttps://www.debian.or.jp/using/mirror.htmlに、日本の一覧があります。

[AWS – Lightsail] SSHのセキュア設定

なんか謎にGCEのf1-microが課金されだしたので、去年の夏頃に半額になりすごくお得感のあるAWSのLightsailに乗り換えました。

一番安いプランで$3.5! 素晴らしい。
加えて一番安いプランは一ヶ月無料なんですね!

3.50 USD にて Lightsail プランを 1 か月間 (750 時間まで) 無料で ご利用いただけます。Microsoft Windows Server をご利用の場合は、8 USD のプランを 1 か月間無料でご利用いただけます。また、マネージドデータベースプランをご利用の場合には、15 USD のプランを 1 か月無料でご利用いただけます。最初の Lightsail サーバーを起動する際に適切なプランを選択すると、お客様のアカウントに 1 か月間無料のクレジットが付与されます。*
https://aws.amazon.com/jp/lightsail/pricing/

Lightsailは実質T2インスタンスのCPUクレジットを絞ったバージョンと聞いたので、CPUをよく使う用途には向いてませんが個人のブログとかでは十分でしょう。


今回は大好きなDebian Stretchを使用しています。UbuntuでもSSHの設定はほぼ変わらないです。CentOSは知らないです(´・ω・`)

続きを読む

dpkg: error processing package google-cloud-sdk (–configure)

GCEでf1-microでインスタンスを立ててログインすると、まずはとりあえずアップデートをすると思います。

$ sudo apt-get update; sudo apt-get upgrade -y;

するとなんと、

dpkg: error processing package google-cloud-sdk (–configure):
subprocess installed post-installation script returned error exit status 137

えっ。って感じです。ここ数日立てたf1-microはこうなりました。
遺憾です。依存関係かなと思いとりあえず

$ sudo apt-get -f install

をしましたが解決しません。

そこでググるとStack Overflowに

The direct cause may be a lack of memory. Try to add swap before upgrading.

Upgrading google-cloud-sdk Fails on Configure

とあったので、まさかと思いスワップファイルを作成。

$ sudo dd if=/dev/zero of=/swap bs=1024k count=2048
$ sudo mkswap /swap
$ sudo chmod 0600 /swap
$ sudo swapon /swap

その後アップグレードすると成功しました。
ところでGCEはデフォルトでスワップがないので、fstabに今回作ったスワップファイルを書いておきましょう。

$ sudo vim /etc/fstab

/swap swap swap defaults 0 0

これで再起動してもスワップが保持されます。

[template id=”99″]

[Debian] certbot のエラー pkg_resources.DistributionNotFound


$sudo certbot
Traceback (most recent call last):
  File "/usr/bin/certbot", line 6, in 
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3019, in 
    @_call_aside
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3003, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3032, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 655, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 963, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 849, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'ndg-httpsclient' distribution was not found and is required by requests

Let’s Encryptのcertbotを実行したときにこんな感じのエラーが出る時、
python-pkg-resourcesを再インストールすることで(多分)解決します。

$ sudo apt-get remove --purge python-pkg-resources
$ sudo apt-get install python-pkg-resources