Skip to content

Instantly share code, notes, and snippets.

beci / docker-compose-postgres-with-healt-check.txt
Last active November 7, 2022 22:26
A sample (from featmap) docker service definition with healthcheck
# link
image: postgres:11-alpine
restart: always
- ${PWD}/data:/var/lib/postgresql/data
beci /
Created July 1, 2021 05:59 — forked from a-r-d/
How to take an annoying APE + CUE file cd rip and convert it into a set of FLAC or MP3 files on ubuntu.
#first install all the things:
sudo apt-get install flac ffmpeg mp3splt libav-tools shntool
# Okay first lets do an MP3:
# input files:
# --> cd.ape
# --> cp.cue
# (there are other options, like bitrate, but this is just the bare bones)
avconv -i cd.ape cd.mp3

Notes about the machine

The hardware

  • Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz
  • Gigabyte X79-UD3
  • 16GiB RAM, DDR3-1866, 2x Corsair CMZ12GX3M3A16, 2x Kingston KHX1600C9D3/4

Linux settings

#!/usr/bin/env bash
#curl -s | bash
#aws ec2 describe-images --owners 093273469852 --filters "Name=root-device-type,Values=ebs" --filters "Name=virtualization-type,Values=hvm" --query 'Images[*].[Name]' --output text
#aws ec2 describe-instances --query 'Reservations[*].Instances[*].[InstanceId,State.Name,LaunchTime,PublicDnsName,PublicIpAddress,KeyName,InstanceType]'
# run by curl
sudo pacman -S --noconfirm pacman-contrib
beci / downgrade python for pytorch and tensorflow, 3.8 to
Last active February 6, 2020 18:08
Machine learning packages a step behind python releases. Python is upgraded to 3.8 in arch linux based distros recently, but pytorch and tensorflow support up to 3.7 yet

downgrade python for pytorch and tensorflow

1. install the required version of python

On arch linux python37 from AUR, using yay:

yay -S python37
2. create the virtual environment with the installed version of python
python3.7 -m venv venv
beci /
Last active June 22, 2024 11:10
Speed up compiling of AUR packages in arch linux

Edit /etc/makepkg.conf

replace in CFLAGS and CXXFLAGS to use the native one

-march=x86-64 -mtune=generic to -march=native

speed up build by set multiple threads


# with filter for only enabled
Get-ADUser -LDAPFilter "(&(objectCategory=person)(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2))" -Properties * | select Name,UserPrincipalName,Enabled,LockedOut,Created,LastLogonDate | ConvertTo-Json > users_f.json
# with all users
Get-ADUser -Filter * -Properties * | select Name,UserPrincipalName,Enabled,LockedOut,Created,LastLogonDate | ConvertTo-Json > users.json
beci / 256
Created March 11, 2019 11:57 — forked from limingjie/256
256 colors in putty, tmux/screen and vim

#256 colors in putty, tmux/screen and vim There is a detailed answer on stackoverflow. If you are looking for a short one, here it is.

  • putty

    Set Connection -> Data -> Terminal-type string to xterm-256color

  • tmux

Add this line to ~/.tmux.conf

beci / qbittorrent as default magnet handler
Created September 9, 2018 19:31
Set qbittorrent as default magnet link handler in gnome (arch)
# step 1: install xdg-utils
sudo pacman -S xdg-utils
# step 2: set qbittorrent to default magnet hangler
xdg-mime default qbittorrent.desktop x-scheme-handler/magnet
gci -inc bin,obj -rec | rm -rec -force
# without alias: Get-ChildItem -inc bin,obj -rec | Remove-Item -rec -force