Skip to content

Instantly share code, notes, and snippets.

@beci
beci / convert-and-split.sh
Created Jul 1, 2021 — forked from a-r-d/convert-and-split.sh
How to take an annoying APE + CUE file cd rip and convert it into a set of FLAC or MP3 files on ubuntu.
View convert-and-split.sh
#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
View Gigabyte X79-UD3.md

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

View aws-arch-eu-central1.sh
#!/usr/bin/env bash
#curl -s https://gist.githubusercontent.com/beci/53cddb049995d9994e41f119b8b03a87/raw/bfb6afa1a37a8c03240c7961c69d4a796fe5812e/aws-arch-eu-central1.sh | 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
beci / downgrade python for pytorch and tensorflow, 3.8 to 3.7.md
Last active Feb 6, 2020
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
View downgrade python for pytorch and tensorflow, 3.8 to 3.7.md

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
beci / aur_speed_up.md
Last active May 25, 2021
Speed up compiling of AUR packages in arch linux
View aur_speed_up.md

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

MAKEFLAGS="-j$(nproc)"

View active directory users
# 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
beci / 256 colors.md
Created Mar 11, 2019 — forked from limingjie/256 colors.md
256 colors in putty, tmux/screen and vim
View 256 colors.md

#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
beci / qbittorrent as default magnet handler
Created Sep 9, 2018
Set qbittorrent as default magnet link handler in gnome (arch)
View qbittorrent as default magnet handler
# 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
View delete visual studio binaries in poweshell.ps
gci -inc bin,obj -rec | rm -rec -force
# without alias: Get-ChildItem -inc bin,obj -rec | Remove-Item -rec -force
@beci
beci / mka2flac
Last active May 29, 2018
Fish commands to extract track (flac files) from multiple mka file
View mka2flac
# List all tracks from all mka files in Downloads
for fname in (find ~/Downloads -type f -name '*.mka'); mkvmerge -i $fname| grep 'Track ID'; end
# Extract second (number 1) track from all mka files in Downloads
for fname in (find ~/Downloads -type f -name '*.mka'); mkvextract $fname tracks 1:(basename (dirname $fname)).flac; end