data.haus blog

minimal tech for today

VIM tips 5

2022-11-04 - psic4t

VIM tips 4

2022-05-30 - psic4t

Some "g" commands

Pacman

2022-04-20 - psic4t

When I migrated from Ubuntu to Arch I had a hard time remembering Pacman's (the Arch package manager) commands. Here we go:

Consider using yay as a frontend for pacman. Really convernient + fast. Plus you can manage AUR packages with it as well.

Update 2019: Nah.

I use the following aliases/bash functions in .bashrc:

alias upd='sudo pacman -Syu'

alias ins='sudo pacman -Sy'

alias aursearch='curl -s https://aur.archlinux.org/packages.gz
| zgrep'

aurinst () { pushd /home/psic4t/sys/aur &&
git clone https://aur.archlinux.org/"$1".git &&
cd "$1" && makepkg -si && popd; }

GIT for dummys

2021-03-17 - psic4t

I use git only occasionally. Here are some basic commands to remember:

vim tips 3

2019-09-27 - psic4t

Even more of this.

Lineage OS on a Samsung Galaxy S4

2019-06-15 - psic4t

Today I installed Lineage OS on an old Galaxy S4 I found in a drawer. Unfortunately the S4 is already unsupported by the LineageOS guys so you have to rely on someone on XDA developers if you don't want to compile the stuff yourself. I used this ROM.

The installation process is pretty straightforward. Install TWRP reovery fist, then LineageOS.

On your Linux box you need Heimdall installed.

INSTALL TWRP

You have to boot directly to recovery after flashing, otherwise TWRP gets overwritten.

INSTALL LINEAGEOS

Postgres commands

2019-04-08 - psic4t

Only for absolute n00bs (like me).

su - postgres
psql
\l # lists all dbs
\c dbname # connects to dbname
\dt # show tables

Create a new db:

CREATE DATABASE synapse
 ENCODING 'UTF8'
 LC_COLLATE='C'
 LC_CTYPE='C'
 template=template0
 OWNER synapse_user;

Dump a db to file:

pg_dump -U postgres -W -F t mydb > /tmp/mydb.tar

W asks for password, F output file format which is 't' here, for tar

Dump all databases to file:

pg_dumpall -U postgres > /tmp/alldbs.sql

Show current processes:

select * from pg_stat_activity;

Show vacuum progress:

select * from pg_stat_progress_vacuum;

Show size of a certain db:

SELECT
pg_size_pretty (
    pg_database_size ('mydatabase')
);
View more postsRSS