Skip to content

Instantly share code, notes, and snippets.

@amatus
amatus / script.sh
Last active September 17, 2024 15:12
Convert WD My Book Live from old iscsi mode to new ceph osd mode
apt-get -y purge iscsitarget
vi /etc/network/interfaces
cat > /etc/fstab << EOF
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
@amatus
amatus / gist:7af3dd9a51b00fb1e622
Last active August 29, 2015 14:25
Installing ceph
Remove systemd (http://tracker.ceph.com/issues/11344)
http://without-systemd.org/wiki/index.php/How_to_remove_systemd_from_a_Debian_jessie/sid_installation
dpkg -i ceph_*.deb ceph-common_*.deb librados2_*.deb python-rados_*.deb python-cephfs_*.deb librbd1_*.deb libcephfs1_*.deb python-rbd_*.deb
apt-get install -fy
Setup cluster: http://ceph.com/docs/master/install/manual-deployment/
before starting the ceph monitor node: touch /var/lib/ceph/mon/{cluster-name}-{hostname}/sysvinit
before preparing osd nodes: copy /etc/ceph/ceph.conf and /var/lib/ceph/bootstrap-osd/ceph.keyring to the corresponding directories on the osd
@amatus
amatus / gist:5c530ea49f8603b49354
Last active August 29, 2015 14:23
Building ceph for WDC MyCloud
install qemu 2.4 or newer?
update the 64k binutils:
--- binutils/801-mspd-64k-pages-2.patch.orig 2015-06-26 17:35:26.877938743 +0000
+++ binutils/801-mspd-64k-pages-2.patch 2015-06-26 17:35:51.696175783 +0000
@@ -5,8 +5,7 @@
#ifdef __QNXTARGET__
#define ELF_MAXPAGESIZE 0x1000
#else
10:39 < major> well, it goes something like this: ssh-keygen -f
servers_CA;ssh-keygen -f users_CA
10:40 < major> after that: ssh-keygen -s <CA_file> -I <description> -n
<principals> <pubkey_file>
10:40 < major> for users
10:40 < major> and: ssh-keygen -s <CA_file> -I <description> -h -n <hostnamess>
<pubkey file>
10:40 < major> for signing host pubkeys
10:41 < major> you can add a @ca-authority in your authorized keys to trust all
signed keys by that CA
@amatus
amatus / gist:1642b94ac4e797fd1736
Last active August 29, 2015 14:18
GNUnet URI translator (0.10.1 -> 0.10.2+)
cabal install plugins failed with:
cabal: Error: some packages failed to install:
haskell-src-1.0.2.0 failed during the configure step. The exception was:
ExitFailure 1
plugins-1.5.4.0 depends on haskell-src-1.0.2.0 which failed to install.
SOLUTION:
cabal install haskell-src-1.0.1.5\
cabal install plugins
@amatus
amatus / keybase.md
Created August 6, 2014 17:30
keybase.md

Keybase proof

I hereby claim:

  • I am amatus on github.
  • I am amatus (https://keybase.io/amatus) on keybase.
  • I have a public key whose fingerprint is C557 1F92 9030 82B1 6AA9 69BA A080 61C1 6F21 EFE5

To claim this, I am signing this object:

@amatus
amatus / avpk.py
Created May 14, 2014 18:32
Python script to extract an AVPK archive
import sys
import io
import struct
def int32(f):
return struct.unpack('<i', f.read(4))[0]
def string(f):
bs = []
while True:
@amatus
amatus / version.ll
Last active December 26, 2015 09:29
This file has been truncated, but you can view the full file.
target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
target triple = "le32-unknown-nacl"
%struct._IO_FILE = type opaque
%struct.anon = type { i32, i8* }
%struct.gcry_cipher_spec = type { i32, %struct.anon.11, i8*, i8**, %struct.gcry_cipher_oid_spec*, i32, i32, i32, i32 (i8*, i8*, i32)*, i32 (i8*, i8*, i8*)*, i32 (i8*, i8*, i8*)*, void (i8*, i8*, i8*, i32)*, void (i8*, i8*, i8*, i32)*, i32 (i32, i32, void (i8*, i32, i8*, i8*)*)*, i32 (i8*, i32, i8*, i32)*, void (i8*, i8*, i32)* }
%struct.anon.11 = type { i8, [3 x i8] }
%struct.gcry_cipher_oid_spec = type { i8*, i32 }
%struct.gcry_md_spec = type { i32, %struct.anon.98, i8*, i8*, i32, %struct.gcry_md_oid_spec*, i32, void (i8*)*, void (i8*, i8*, i32)*, void (i8*)*, i8* (i8*)*, i32, i32 (i32, i32, void (i8*, i32, i8*, i8*)*)* }
%struct.anon.98 = type { i8, [3 x i8] }
@amatus
amatus / rust_for_rpi.md
Last active February 18, 2017 21:13 — forked from anonymous/gist:6664882
Howto build a rust compiler for the Raspberry Pi on Debian 7.1 (wheezy)

Howto build a rust compiler for the Raspberry Pi on Debian 7.1 (wheezy)

sudo apt-get install git build-essential
test `uname -m` = x86_64 && sudo apt-get install ia32-libs
git clone https://github.com/raspberrypi/tools.git
export PATH=$PWD/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin:$PATH
git clone http://github.com/mozilla/rust.git
cd rust
./configure --target-triples=arm-unknown-linux-gnueabihf

make