ix5 tech
Technology section • ix5.org
Banshee
July 18, 2016
Remove deleted files from internal database Install libdbi-perl and libdbd-sqlite3-perl Make a backup of ~/.config/banshee-1/banshee.db Download reap-dead-tracks.pl from this server or GitHub Run perl reap-dead-tracks.pl <db>, confirm deletion Reload internal database sqlite3 ~/.config/banshee-1/banshee.db "update coretracks \ set LastSyncedStamp = 0 where PrimarySourceID=1" UI Use right mouse button to resize time slider Sync Make an .is_audio_player file in root of external device, describe capabilites Do not start banshee wile an mtp device is connected (Just starting up banshee in the background will cause the connection to fail and mess up everything)
Mixxx reference
February 11, 2016
AutoDJ Activate with Shift-F12, a little android icon will appear in top left corner and control over crossfader will be automated Skip track with Shift-F11 Set fade time to negative value for breaks in between songs, don’t forget to turn it off. Setting a negative value will make mixxx not respect cue points! Use crates to refill cue if necessary Seeking to cue point on load can be turned off in preferences Musicality The BPM detection is insufficicient Knobs Any effect will increase audio latence, this includes key lock Don’t forget to turn off filters after the song has ended Mind the crossfader Use the gain slider cautiously, and turn it off immediately afterwards For effects: select appropriate channel Recording CTRL-R to start-stop recording, little icon will appear in top left corner Organizing Use playlists for tracks in a specific order Tandas are designated T:Genre:Artist(tempo):Singer/mood/etc. (year from-til), where genres are Cd - Candombe Fx - Foxtrot Mi - Milonga (Mi/Cd: Milonga Candombe) Ta - Tango Va - Vals X<Genre> - Fusion (genre), nuevo Setlists are designated Deployment:Date:Location Use crates for collections of tracks Tagging Song title: Name | Alternative Name (canta Singer y Another Singer y coro)(en vivo, extra information). Extra information, in title or otherwhere, is in Spanish Singer also goes into vocal field(which most players do not display) Artist: Just the name, omission of ‘Orquesta’ if possible e.g.: Carlos Di Sarli, Orquesta Típica Victor, Quinteto Francisco Canaro(Dir. Antonio D’Alessandro) Album: Title | Subtitle. If artist is mentioned in album title, include the name in album tag(e.g. Milongueando con Canaro). Disc number goes into a separate tag Genre is capitalized/title cased, e.g. Milonga Candombe Year: Either YYYY or YYYY-MM-DD grouping tag is for eras(guardia vieja, early, late, …), can be displayed in mixxx Use comment field for danceability information/tagging, trivia etc. goes into my notebook Tagging-todo: Implement rating system from 0 to 100 like on tango-dj.at instead of stars, rate for milonga suitability(and custom tag/commandeer one?) Grouping standards(maybe from tejastango) Where to put Instrumental tag? In song title(El chamuyo (Instrumental))? Into grouping? Search Fuzzy matching: ~key:c#m finds “tracks with harmonically compatible keys to C# minor” artist:Danger duration:>3m rating:>=4 genre:hip-hop -year:1990 (negate with -) Building, audio format support Don’t forget to install libmp4v2-2
Firefox modifications
December 20, 2015
Addons Essential uBlock Origin (with custom filters) Stylish Session Manager GrabMyBooks I don’t care about cookies Clean Uninstall New Tab override(since Firefox doesn’t allow setting newtab.url any more for some reason) Suspend Tab (actually works, as opposed to UnloadTab) VimFx(with custom mappings, don’t forget to back up) wallabag(v2) Warn Before Quit Unused UnloadTab (loses tabs, not recommended) Super Start (load a custom html page from file:/// instead) RSVP Reader ScrapBook HTML5 Video Everywhere! (works only sporadically) Resurrect Pages Tab Mix Plus Random Agent Spoofer Content Search X BetterPrivacy QuickMark Privacy Badger (or Disconnect or Ghostery) NoScript (even with javascript turned on, it still offers some security features) Mozilla Archive Format meta-q-override misc remove default mail providers turn off sync, hello, pocket, tiles, weed out search providers, turn off telemetry etc. set default search engine, disable search suggestions about:config browser.search.showOneOffButtons false (deprecated) browser.newtab.url and browser.startup.homepage to about:blank(obsolete, see new tab override) browser.pocket.enabled false beacon.enabled false browser.visited_color #00CCCC dom.max_script_run_time 40 dom.max_chrome_script_run_time 40 (from 20) dom.battery.enabled false (how could anyone think this was a good idea) dom.event.clipboardevents.enabled false general.warnOnAboutConfig false geo.enabled false network.dns.disablePrefetch true pdfjs.disable true plugins.enumerate_names (empty) privacy.trackingprotection.enabled true webgl.disabled true (will break fullscreen mode?) browser.fullscreen.{animateUp,autohide} dom.serviceWorkers.enabled false (what a dumb idea to let scripts run after closing a tab) privacy.file_unique_origin=false - See CVE-2019-11730 But I don’t particularly care Needed so that file:// stuff works properly and doesn’t complain about CORS, e.g. for accessing cssRules devtools.inspector.color-scheme-simulation.enabled=true for testing out prefers-color-scheme, see stackoverflow
Debian cheatsheet
May 16, 2014
This has grown into a very useful list of things that make my life easier. Divided into sections for clarity. Mostly applicable to Ubuntu as well. Nifty shortcuts, one-liners and useful programs netcat for file transfer receiver: nc -l -p 1234 > somefile.png sender: nc -w 3 192.168.178.20 1234 < somefile.png ssh port forwarding ssh -R 80:localhost:8080 user@server.com -i key.pem multiple x sessions exec startx -- :1 vt8 get random SALT openssl rand -base64 32 use imagemagick to resize pictures convert <infile> -resize 100x100 [<outfile>] force aspect ratio convert <infile> -thumbnail '100x100>' -background white -alpha remove -gravity center -extent 100x100 [<outfile>] use imagemagick to create quick thumbnails POSIX, only works with .jpeg, height=200px: for f in *; do; echo $f; convert -thumbnail x200 -background white -alpha remove $f ${f:%.jpeg}_thumb.png; done with zsh: for f in *; do; echo $f; convert -thumbnail x200 -background white -alpha remove $f ${f:r}_thumb.png; done where ${f:r} means “remove file extension from $f”, see zsh archive fast video thumbnails with ffmpegthumbnailer for f in *; do; echo $f; ffmpegthumbnailer -i $f -o ${f:r}_thumb.png -s 400; done imagemagick: crop and then append images Images are 1080x1920, we want to crop them to the middle, but full height. First, create the needed folders folders, with files named identically: mkdir before now cropped_{before,now}, so that you have e.g. before/1.png, now/1.png, before/2.png, now/2.png and so forth. Then, figure out the crop dimensions, e.g. 800x1080+580+0 where we want an image 800x1080 in dimension, and we carve it out with the x-offset of 580 and y-offset of 0. Then, run the following imagemagick commands: # Crop all before images for f in before/*; do i=${f#before/} && echo $i && \ convert -crop 800x1080+580+0 before/$i cropped_before/cropped_$i done` # Crop all after images for f in now/*; do i=${f#now/} && echo $i && \ convert -crop 800x1080+580+0 now/$i cropped_now/cropped_$i done` # Merge the cropped before and after pictures side-by-side for f in before/*; do i=${f#before/} && echo $i && \ convert +append cropped_before/cropped_$i cropped_now/cropped_$i $i done` ffmpeg gif optimizer ffmpeg -i input.mp4 -r 10 -f image2pipe -vcodec ppm - | convert -loop 0 - output.gif find and remove “~” files from emacs etc. find . -name*\~ | xargs rm use quvi to download videos etc quvi --exec "wget -O <name.webm> %u" <link> or just use youtube-dl set .mp4 metadata from filename for f in *.mp4; do title="${${f#"Series Name to Remove"}%".mp4"}" exiftool "$f" -Title="$title" -Artist= done Where Series Name to Remove is a prefix to remove count words (or lines) wc [-l] print all file types in a directory find . -type f -name "*.*" | awk -F. '{print $NF}' | sort -u or just print number of files of one filetpye: find . -name "*.mp3" -type f | wc -l count number of files find <dir> -type f | wc -l generate random number shuf -i 2000-65000 -n 1 recover data from btrfs partitions from superuser run strings /dev/sda1 | less and then use / to search for the strings that could be in that file. delimit the start of it with “m” then move to the end and use |cat >file to save it to a file (note: worked on text for me, binary could be difficult) tre-agrep cat file.txt | tre-agrep -i(ignorecase) -s(show match cost) -3(max cost of 3) 'Fuzzy match' -D: cost of missing characters -I: cost of extra characters -S: cost of substitutions(should be x2 since deletion and insertion are 2 operations) load testing use siege --concurrent=100 manipulate systemd units from users as root systemctl --user --machine=<user>@.host list-units where <user> the actual user, but host is written verbatim Pdf handling use pdftk to split a document into multiple pages pdftk A=input.pdf cat A1-100 output output-1-100.pdf
Vim cheat sheet
May 16, 2014
Folds za to toggle current fold zm to close, zr to open Windows from windows A buffer is the in-memory text of a file. A window is a viewport on a buffer. A tab page is a collection of windows.