Skip to content

Instantly share code, notes, and snippets.

@Denperidge
Last active August 26, 2021 12:35
Show Gist options
  • Save Denperidge/6f0b4566803a79d2153dd6d6f9a139d0 to your computer and use it in GitHub Desktop.
Save Denperidge/6f0b4566803a79d2153dd6d6f9a139d0 to your computer and use it in GitHub Desktop.
Links and instructions to fix problems I've encountered!

Bugs and issues and how to troubleshoot them

Links and instructions to do or fix specific problems!








Windows 10

Windows Explorer navigation pane cleanup

Windows+R -> regedit.exe ->

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\

Source







Linux

Setup a guest smb/samba

sudo adduser GUESTNAME
sudo smbpasswd -a GUESTNAME
sudo nano /etc/samba/smb.conf

And in the smb.conf, add the following to the end of the file:

[public]
  Comment = Publicly accessible directory
  Path = /path/to/directory
  Public = Yes
  Browseable = Yes
  Writeable = Yes
  Guest Ok = Yes
  Guest Account = GUESTNAME

(Remember to put the correct chmod on the directory. I didn't want guests to be able to write to it, so I used 775. But that depends on your preferences!)

And then run sudo service smbd restart

Sources: this SO post and the smb.conf documentation

Disable Laptop screen on boot

(In my experience, having the 'nomodeset' parameter set interfered with this solution) https://www.reddit.com/r/linuxquestions/comments/1l3eab/disabling_laptop_monitor_on_boot/cbvkzon

vbetool -> mmap /dev/zero: Operation not permitted

mmap /dev/zero: Operation not permitted Failed to initialise LRMI (Linux Real-Mode Interface).

mount -o remount,exec /dev
vbetool dpms force off
mount -o remount,noexec /dev

https://bugs.launchpad.net/ubuntu/+source/vbetool/+bug/1875240/comments/7

Disable sleep on laptop lid close

Add HandleLidSwitch=ignore to /etc/systemd/logind.conf and reboot

https://askubuntu.com/a/372616

Cockpit in ubuntu apt-get outdated

# sudo apt install cockpit/bionic-backports  # For Ubuntu 18
# sudo apt-install cockpit/focal-backports # for Ubuntu 20

Caddy setup with DNS Challenge

Setup Caddy with a DNS challenge for use on your VPN. Advantages are:

  • Not requiring Caddy/your server to be accessible to the internet
  • Allowing wildcard certificates
  • Using a subdomain for your VPN stuff

First of all, make sure your DNS provider is supported by Caddy. Here's a list of official supported DNS providers. If it isn't, no need to worry, you don't need to switch your entire setup. Simply select any DNS provider from the list before (I've used DigitalOcean since it's free, note that I've had issues with Cloudflare but hey). Then in your main dns provider, simply add the necessary NS records your Caddy-supported provider (you can use vpn.yourdomain.com as a host for example), and done!

  • Configure the installer with your Linux version & Caddy DNS Provider included: https://caddyserver.com/download?package=github.com
  • Use this simple bash script I wrote or the official instructions (on which the bash script is based) to install caddy as a service (and give Caddy access to the lower ports if need be)
  • Create A records in your Caddy DNS provider to point to the IP of your Caddy server. This can just be the private IP from your VPN for example
  • Add your email and DNS provider API key to the service configuration (nano /etc/systemd/system/caddy.service) like so:
    [Service]
    # ...
    # Other settings
    # ...
    Environment="caddy_mail=your@mail.com"
    Environment="caddy_api_key=yourapikey"
    (Note, email isn't always necessary, only when you have issues with your certificates, but I just added it to be safe)
  • Create a Caddyfile in /etc/caddy/, with a setup like seen here:
    {
          email {env.caddy_mail}
          acme_dns yourcaddydnsprovider {env.caddy_api_key}
    }
    
    vpn.example.com {
            respond "Hello!"
    }
    
    subdomain.vpn.example.com {
            reverse_proxy :9000
    }
    
    anythingoeshere.vpn.example.com {
            reverse_proxy :8000
    }
    

Update-grub on Fedora

https://fedoraproject.org/wiki/GRUB_2#Updating_GRUB_2_configuration_on_BIOS_systems







Dev

Could not open a connection to your authentication agent

https://stackoverflow.com/a/17848593/5522348

Multiple git accounts

  1. Tutorial for creating SSH links https://www.freecodecamp.org/news/manage-multiple-github-accounts-the-ssh-way-2dadc30ccaca/ (other article for the same thing)
  2. Add github.com to trusted hosts ome/devspace#38 (comment)
  3. And for the eventual snafu: https://stackoverflow.com/a/41350134

Debugging Safari iOS on PC/Windows/Linux

Installing Flutter from git in Android Studio/Windows but you've put everything on a second drive because your main drive was running out of space and now the flutter installation doesn't work

  • Install Android Studio
  • Use the git clone command as described here
  • From the bin folder, run flutter && flutter doctor to verify your installation.
  • If your Android SDK installation is in a non-standard location, you have to use the following command. flutter config --android-sdk "D:/Path/To/Android/" (For me it only worked with the forwards slashes being used instead of the backward slashes, but your experience may vary)
  • Install the JDK and set the JAVA_HOME environment variable to its installation folder
  • If flutter doctor --android-licenses gives an Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema", you may need to install the Android SDK Command-Line Tools
  • Use flutter config --android-studio-dir "D:/Path/To/Android Studio"
  • Run flutter doctor to make sure everything is okay and configured
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment