Skip to content

Instantly share code, notes, and snippets.

View luispabon's full-sized avatar

Luis Pabon luispabon

  • Auron Consulting Ltd
  • London
View GitHub Profile
~ swaymsg -t get_outputs Thu 02 Apr 2020 11:03:11 BST
Output eDP-1 'Sharp Corporation 0x1476 0x00000000' (focused)
Current mode: 3840x2160 @ 59.997002 Hz
Position: 0,1081
Scale factor: 2.000000
Scale filter: nearest
Subpixel hinting: unknown
Transform: normal
Workspace: 2
Max render time: off
@luispabon
luispabon / wofi-swytch.sh
Created February 11, 2020 16:49
Swytch with Wofi
#!/bin/bash
# Swytch is a script providing a window switcher for sway using rofi, awk and jq.
# The script is based on:
# https://www.reddit.com/r/swaywm/comments/aolf3u/quick_script_for_rofi_alttabbing_window_switcher/
# Copyright (C) 2019 Björn Sonnenschein
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
@luispabon
luispabon / bt full
Created January 16, 2020 20:52
waybar crash
#0 0x0000556fe10a9047 in std::__remove_if<__gnu_cxx::__normal_iterator<std::unique_ptr<waybar::waybar_output>*, std::vector<std::unique_ptr<waybar::waybar_output> > >, __gnu_cxx::__ops::_Iter_pred<waybar::Client::handleMonitorRemoved(Glib::RefPtr<Gdk::Monitor>)::<lambda(const auto:2&)> > > (__pred=..., __last=std::unique_ptr<waybar::waybar_output> = {get() = 0x0}, __first=
std::unique_ptr<waybar::waybar_output> = {get() = 0x0}) at /usr/include/c++/9/bits/unique_ptr.h:352
__result = std::unique_ptr<waybar::waybar_output> = {get() = 0x556fe16aa5e0}
__result = <optimised out>
#1 std::remove_if<__gnu_cxx::__normal_iterator<std::unique_ptr<waybar::waybar_output>*, std::vector<std::unique_ptr<waybar::waybar_output> > >, waybar::Client::handleMonitorRemoved(Glib::RefPtr<Gdk::Monitor>)::<lambda(const auto:2&)> > (__pred=..., __last=..., __first=...) at /usr/include/c++/9/bits/stl_algo.h:939
No locals.
#2 waybar::Client::handleMonitorRemoved (this=<optimised out>, monitor=...) at ../src/client.cpp
  • Based on https://gist.github.com/mdziekon/221bdb597cf32b46c50ffab96dbec08a
  • Installation date: 16-08-2019
  • Additional notes based on my own experience
  • EFI boot
  • Ubuntu 19.04 -> 21.04
  • This should work on any computer. Only the RAID > AHCI change described below and the device name for the nvme ssd drive are specific to this laptop.
  • The process describes a completely fresh installation with complete repartitioning, however it should work fine when Windows is already installed (eg. brand new machine with Windows preinstalled) as long as Windows already boots with EFI.
  • The process was conducted on Dell's XPS 15 9560 (2017) with specs:
  • CPU: i7-7700HQ
@luispabon
luispabon / backtrace
Last active July 2, 2019 14:12
swaylock segfault
bt full
#0 0x00007ff1f521ec00 in xkb_state_layout_index_is_active ()
from /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0
No symbol table info available.
#1 0x00005605eaa7890d in keyboard_modifiers ()
No symbol table info available.
#2 0x00007ff1f43f181e in ffi_call_unix64 () from /usr/lib/x86_64-linux-gnu/libffi.so.6
No symbol table info available.
#3 0x00007ff1f43f11ef in ffi_call () from /usr/lib/x86_64-linux-gnu/libffi.so.6
No symbol table info available.
@luispabon
luispabon / lockscreen.log
Created June 26, 2019 09:11
swaylock crash on suspend
2019-06-19 17:37:38 - [sway/input/switch.c:38] 0:5:Lid_Switch: type 1 state 1
2019-06-19 17:37:38 - [types/wlr_surface.c:609] New wlr_surface 0x56004c58bb40 (res 0x56004c3c7c20)
2019-06-19 17:37:38 - [types/wlr_surface.c:609] New wlr_surface 0x56004c5b7120 (res 0x56004c1e9ab0)
2019-06-19 17:37:38 - [types/wlr_layer_shell_v1.c:388] new layer_surface 0x56004c682ad0 (res 0x56004c3d3e90)
2019-06-19 17:37:38 - [sway/desktop/layer_shell.c:368] new layer surface: namespace lockscreen layer 3 anchor 3 size 0x0 margin 0,0,0,0
2019-06-19 17:37:38 - [sway/desktop/layer_shell.c:314] Layer surface destroyed (lockscreen)
Segmentation fault (core dumped)
2019-06-19 17:37:38 - [sway/tree/arrange.c:190] Usable area for ws: 1920x1045@0,35
2019-06-19 17:37:38 - [sway/tree/arrange.c:221] Arranging workspace '3' at 0.000000, 35.000000
2019-06-19 17:37:38 - [sway/desktop/transaction.c:412] Transaction 0x56004c4e6360 committing with 4 instructions
@luispabon
luispabon / Dockerfile
Created May 15, 2019 21:19
Example symfony and encore dockerfile
###########
# Backend #
###########
# Dev env base container
FROM phpdockerio/php73-fpm:latest AS backend-dev
WORKDIR "/application"
# Fix debconf warnings upon build
ARG DEBIAN_FRONTEND=noninteractive
@luispabon
luispabon / apps-bin-path.sh
Created May 14, 2019 10:03
Snap app support in shell
# shellcheck shell=sh
# Expand $PATH to include the directory where snappy applications go.
snap_bin_path="/snap/bin"
if [ -n "${PATH##*${snap_bin_path}}" -a -n "${PATH##*${snap_bin_path}:*}" ]; then
export PATH=$PATH:${snap_bin_path}
fi
# Ensure base distro defaults xdg path are set if nothing filed up some
# defaults yet.
##################################################
# Fancy PWD display function
##################################################
# The home directory (HOME) is replaced with a ~
# The last pwdmaxlen characters of the PWD are displayed
# Leading partial directory names are striped off
# /home/me/stuff -> ~/stuff if USER=me
# /usr/share/big_dir_name -> ../share/big_dir_name if pwdmaxlen=20
##################################################
bash_prompt_command() {
@luispabon
luispabon / README.md
Created September 9, 2018 13:35
Brother DCP-7055 scanner on ubuntu bionic 18.04

DCP-7055 scanner (brscan4) fix

The printer has always worked in Ubuntu out of the box.

The old driver page at the Brother website contains drivers that won't work on Bionic no longer though. You need to use a newer version provided here: http://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=mfcj470dw_us_eu_as&os=128

The old page has the 0.4.2 version of the driver, but Bionic needs 0.4.5 dated May 2018 on that page above. Best to use the installer script at the top of that page (it will add a second printer you can delete, but fixes the scanner).