Skip to content

Instantly share code, notes, and snippets.

@smac89
smac89 / fbootfix.md
Last active September 25, 2023 16:41
Linux Fix Fastboot "no permissions, verify udev rules"
View fbootfix.md

Determine your device id

  1. Unplug your device from the computer and type lsusb in the terminal. You should get an output similar to this:
Bus 002 Device 002: ID 8087:8000 Intel Corp. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 005: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
@smac89
smac89 / install_ffmpeg.sh
Last active August 22, 2023 19:48
Install latest version of ffmpeg on Ubuntu
View install_ffmpeg.sh
#!/bin/bash
sudo apt-get update
sudo apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev \
libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev \
libxcb-xfixes0-dev pkg-config texinfo zlib1g-dev
# Create a dir where the rest of the sources will live
mkdir ~/ffmpeg_sources
@smac89
smac89 / zsh-lazy.md
Last active August 4, 2023 05:56
ZSH lazy loading #zsh #lazy
View zsh-lazy.md
@smac89
smac89 / post.md
Last active July 28, 2023 02:18
Xfce Lockscreen with xsecurelock and xscreensaver #linux #xfce
View post.md
  • Install both xscreensaver and xsecurelock using your package manager

  • Make sure xscreensaver is not set to lock the screen or to manage the display. Xfce aleady does all those, so there is no need to enable it again.

  • Also make sure that the xscreensaver daemon is not autostarted. Not doing this may result in the screen not being locked.

  • Set the following environmental variables (in ~/.xprofile or ~/.xsession) for xsecurelock:

    # xsecurelock options
    

export XSECURELOCK_SAVER=saver_xscreensaver

@smac89
smac89 / Main.java
Last active January 24, 2023 21:32
Read a large json file, but do so lazily so as to not use too much memory. Thanks to Java 8 streams, this is quite possible
View Main.java
import com.google.common.io.Resources;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonObject;
import java.io.IOException;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Stream;
@smac89
smac89 / journal.log
Last active July 16, 2021 05:13
KDE plasma crash on external monitor hotplug
View journal.log
-- Journal begins at Sat 2021-06-12 17:25:40 CST, ends at Thu 2021-07-15 23:05:02 CST. --
Jul 15 23:03:06 ArcoB kscreen_backend_launcher[3064]: kscreen.xcb.helper: RRNotify_OutputChange
Jul 15 23:03:06 ArcoB kscreen_backend_launcher[3064]: kscreen.xcb.helper: Output: 677
Jul 15 23:03:06 ArcoB kscreen_backend_launcher[3064]: kscreen.xcb.helper: CRTC: 0
Jul 15 23:03:06 ArcoB kscreen_backend_launcher[3064]: kscreen.xcb.helper: Mode: 0
Jul 15 23:03:06 ArcoB kscreen_backend_launcher[3064]: kscreen.xcb.helper: Rotation: "Rotate_0"
Jul 15 23:03:06 ArcoB kscreen_backend_launcher[3064]: kscreen.xcb.helper: Connection: "Connected"
Jul 15 23:03:06 ArcoB kscreen_backend_launcher[3064]: kscreen.xcb.helper: Subpixel Order: 0
Jul 15 23:03:06 ArcoB kscreen_backend_launcher[3064]: kscreen.xcb.helper: RRScreenChangeNotify
Jul 15 23:03:06 ArcoB kscreen_backend_launcher[3064]: kscreen.xcb.helper: Window: 25165829
@smac89
smac89 / instructions.md
Created May 28, 2021 22:05 — forked from matthewjberger/instructions.md
Install a nerd font on ubuntu
View instructions.md

1.) Download a Nerd Font

2.) Unzip and copy to ~/.fonts

3.) Run the command fc-cache -fv to manually rebuild the font cache

@smac89
smac89 / sparse.md
Created May 16, 2021 05:30
Git sparse checkout a folder from specific branch
View sparse.md
@smac89
smac89 / upgrade_packages.md
Last active May 14, 2021 20:22
Updating all packages installed by various package managers (brew, sdkman, gem, pip, etc)
View upgrade_packages.md

Brew

brew update && brew upgrade $(brew outdated)

SDKMAN

sdk selfupdate && sdk upgrade <package>

Gem

gem update $(gem list | cut -d' ' -f1)

Pip