Skip to content

Instantly share code, notes, and snippets.

View AndreaGhizzoni's full-sized avatar

Andrea Ghizzoni AndreaGhizzoni

View GitHub Profile
@AndreaGhizzoni
AndreaGhizzoni / passbolt.md
Last active June 23, 2019 15:26
passbolt.md
docker network create passbolt_network

docker volume create mariadb_passbolt_data

docker run -d --name mariadb --net passbolt_network \
             --mount source=mariadb_passbolt_data,target=/var/lib/mysql \
             -e MYSQL_ROOT_PASSWORD=<root_password> \
             -e MYSQL_DATABASE=<mariadb_database> \
             -e MYSQL_USER=<mariadb_user> \
@AndreaGhizzoni
AndreaGhizzoni / ufw_commands.md
Last active June 9, 2019 09:33
ufw_commands.md

setup

enable/disable ufw

sudo ufw enable|disable

enable at startup

sudo systemctl ufw enable

How to mount local image [src]

The problem is that the .img files are not images of a partition, but of a whole disk. That means they start with a boot loader and a partition table. You have to find out the offset of the partition and mount it with the offset option of mount. If you do a

fdisk -l /path/to/image

how to mount ntfs drive with correct permission [src]

Find the UUID of your device:

$ blkid
/dev/sda1: LABEL="xxx" UUID="yyyyyyyy" TYPE="vfat" PARTUUID="kkkkkk"
/dev/sdb1: LABEL="xxx" UUID="<selected-device-uuid>" TYPE="ntfs" PTTYPE="dos" PARTUUID="uuuuuuuu"

Find the uid and gid of your current user:

@AndreaGhizzoni
AndreaGhizzoni / gogs-server.md
Last active April 25, 2018 10:05
gogs-server.md

Create a new user

$ useradd -m -d /home/git -s /bin/bash git
$ sudo passwd git
$ su - git
$ whoami
git
$ pwd
@AndreaGhizzoni
AndreaGhizzoni / gitserver.md
Last active April 24, 2018 20:10
gitserver.md

Installing private Git Server

Note while learning how to install a bare private git server.

Sources

dev.to and linux.com

Setting up server

Let's assume we have a server called gitserver.local, with a normal user bob and a working SSH service. Log in with SSH via:

@AndreaGhizzoni
AndreaGhizzoni / ssh.md
Last active April 24, 2018 20:05
ssh.md

SSH

For Windows

Download GitBash from here, run git-bash.exe that is a custom MINGW64 for git and run the same commands as linux. Replace every *.local name with the corresponding IP address.

Generate RSA keys

To generate a public and private keys under ~/.ssh run the following command:

@AndreaGhizzoni
AndreaGhizzoni / how-to-trash-files-from-cli.md
Last active February 1, 2018 09:59
how-to-trash-files-from-cli.md

How to trash a file from CLI

$ mv file-to-trash ~/.local/share/Trash/files
@AndreaGhizzoni
AndreaGhizzoni / seedbox.md
Last active January 29, 2018 11:38
seedbox.md

Seedbox

Install Transmissions as daemon

$ sudo apt-get install transmission-daemon

start & stop the daemon

$ sudo service transmission-daemon start