docker

Posted on So 24 März 2019 in Notebook • Tagged with notebook, linux, utilities

Dockerfile

FROM gentoo/portage:latest as portage
FROM gentoo/stage3-amd64:latest

COPY --from=portage /var/db/repos/gentoo /var/db/repos/gentoo

ENV ACCEPT_KEYWORDS="~amd64" \
    EMERGE_DEFAULT_OPTS="--jobs=4 --quiet" \
    FEATURES="-sandbox -usersandbox -ipc-sandbox -network-sandbox -mount-sandbox -pid-sandbox" \
    MAKEOPTS="-j4" \
    USE=""

RUN emerge dev-vcs/git app-portage/repoman dev-util/pkgcheck \
 && rm -rf /var …

Continue reading

VirtualBox

Posted on Sa 29 April 2017 in Notebook • Tagged with notebook, linux, utilities

Shrink a vdi VirtualBox disk image

  • Run defrag in the guest (Windows only)
  • Nullify free space:

With a Linux Guest run this:

cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill

With a Windows Guest, download SDelete from Sysinternals and run this:

sdelete.exe c: -z …

Continue reading

Creating a new GPG key

Posted on Mo 20 Juli 2015 in Notebook • Tagged with notebook, linux, utilities

At the time of writing GnuPG unfortunately defaults to a 1024 bit DSAkey as the primary with SHA1 as the preferred hash. Due to weaknessesfound with the SHA1 hashing algorithm Debian prefers to use keys thatare at least 2048 bits and preferring SHA2. The following instructionsprovide a guide to how …


Continue reading

git

Posted on Mo 20 Juli 2015 in Notebook • Tagged with notebook, linux, utilities

clean up git

git reflog expire --expire=1.minute refs/heads/master
git fsck --unreachable
git prune
git gc

A simple way to create git repository on a server machine connecting via ssh

Create a working copy repository

First, create a new local git repository and add all files within …


Continue reading

Using Xephyr

Posted on Fr 08 August 2014 in Notebook • Tagged with notebook, linux, utilities

$ Xephyr -ac -screen 800x600 -reset :1 &

-ac : Disables access control restrictions and allows to forward the session -screen : sets the resolution of the new X session. Set it according to your need. -:1 : This specifies that the new X session is display number “1“. Your current Display is most probably …


Continue reading

Unzipping a problematic archive

Posted on Fr 08 August 2014 in Notebook • Tagged with notebook, linux, utilities

Nice little tip for unzipping problematic archives (.zip) from AskUbuntu.com. I downloaded a .zip archive and could not for the life of me unzip. I tried gunzip and unzip – both failed with the following errors:

Gunzip

$ gunzip foo.gzip
gzip: foo.gzip: unknown suffix -- ignored

Unzip

$ unzip foo.zip …

Continue reading

Config

Posted on Fr 08 August 2014 in Notebook • Tagged with notebook, linux, utilities

Boot Kernel Command Line

On boot systemd activates (by default), the target unit default.target whose job is to activate services and other units by pulling them in via dependencies.

To override the unit to activate, systemd parses its own kernel command line arguments via the systemd.unit= command line …


Continue reading

Commands

Posted on Fr 08 August 2014 in Notebook • Tagged with notebook, linux, utilities

permissions

find /home/user -type d -print0 | xargs -0 chmod 0775
find /home/user -type f -print0 | xargs -0 chmod 0664

clean up dconf

For a single key:

dconf reset "/path/to/the/key"

Must …


Continue reading

systemd-nspawn

Posted on Sa 30 Juli 2011 in Notebook • Tagged with notebook, linux, utilities

Systemd

Kernel

You need support for namespaces and multiple devpts instances in your kernel:

CONFIG_UTS_NS=y
CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y

Container

Downloading the Stage Tarball:

mkdir /var/lib/machines/gentoo-stage3-amd64 && cd /var/lib/machines/gentoo-stage3-amd64
wget https://gentoo.osuosl.org/releases/amd64/autobuilds/current-stage3-amd64 …

Continue reading