Skip to content

Instantly share code, notes, and snippets.

View TheTechRobo's full-sized avatar

TheTechRobo

View GitHub Profile
@bzub
bzub / 20180819-crostini_sommelier_fix.md
Last active January 24, 2024 12:15
Fix Crostini Wayland/X (sommelier) service

If you can't get X11 or Wayland GUI Linux apps to start anymore on Chrome OS, try the following.

In the Terminal app, this will show the status of your systemd user services/units:

systemctl --user

If sommelier@0.service and sommelier-x@0.service show a failed status, the following worked for me:

sudo ln -s /opt/google/cros-containers/bin/sommelier.elf /usr/bin/
@jcward
jcward / _readme.txt
Created April 6, 2018 16:43
A Perl-regex based copy script, derived from the rename script
I really like the regex syntax of the rename perl script, e.g.:
rename "s/OldFile/NewFile/" OldFile*
I simply wanted the same thing with a copy command:
copy "s/OldFile/NewFile/" OldFile*
So here it is!
@DimChtz
DimChtz / ytdl.pyw
Last active January 29, 2020 00:00
Python script (GUI) to download YouTube videos (as video or audio).
# You need to install pafy, pillow and youtube-dl otherwise it won't work
# pip install pafy
# pip install pillow
# pip install youtube-dl
from importlib.util import find_spec as find_lib
from os.path import expandvars as os_vars
from urllib.request import urlopen
from PIL import Image, ImageTk
import tkinter.filedialog
@EvieePy
EvieePy / error_handler.py
Last active January 16, 2024 15:12
Simple Error Handling for ext.commands - discord.py
"""
If you are not using this inside a cog, add the event decorator e.g:
@bot.event
async def on_command_error(ctx, error)
For examples of cogs see:
https://gist.github.com/EvieePy/d78c061a4798ae81be9825468fe146be
For a list of exceptions:
https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#exceptions
@cheerfulstoic
cheerfulstoic / Repository Maintenance Levels.md
Last active May 13, 2024 20:03
Repository Maintenance Levels

After reading Why I'm Frequently Absent from Open Source by James Long and listening the corresponding The Changelog episode, I dwelt on the idea and believe that open source maintainers...

  • ... should never be ashamed if they don't have time for a project.
  • ... should be honest with themselves and open with their users so that everybody can be on the same page
  • ... are people and they have at one time or another responsibilities or hardships that they need to attend to which reasonably take them away from a project
  • ... may also reasonbly decide that they don't like the direction of a project or that they would like to explore other things and may leave a project permanently.

Along this line of thinking I've created a set of descriptions for different levels at which a project might be maintained. A maintainer can use these to announce to their users the current ability that they have to dedicate to a pr

@vicrucann
vicrucann / glsl.xml
Created February 17, 2017 23:17
GLSL syntax highlighter for Qt Creator
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<!-- the version of this file shows the largest supported OpenGL version, second digit is the minor patch level (Y.XP = supports GLSL X.Y0 with patchlevel P -->
<language name="GLSL" section="Sources" extensions="*.glsl;*.vsh;*.vert;*.tcsh;*.tcs;*.tesh;*.tes;*.gsh;*.geo;*.geom;*.fsh;*.frag;*.csh;*.cs" mimetype="text/x-glslsrc" version="4.31" kateversion="2.4" author="Robert Menzel (mail@renderingpipeline.com)" license="LGPL">
<highlighting>
<!-- ####################################################################################################### keywords -->
<list name="keywordsCompatibility">
<!-- compatibility mode, older GLSL versions -->
<item>attribute</item>
@citrusui
citrusui / dropdown.md
Last active May 15, 2024 01:34
"Dropdowns" in Markdown
How do I dropdown?
This is how you dropdown.

<details>
<summary>How do I dropdown?</summary>
<br>
This is how you dropdown.
#!/usr/bin/env python
"""
This script collects Vine URLs from the Twitter API and writes them to the
current working directory as time stamped files. Each file contains roughly an
hour's worth of activity. Each line includes a Tweet Identifier and the
Vine URL that was found in it.
When it first starts it gets the last 1000 and then goes to sleep for
60 seconds. When it wakes up it goes and gets any vine URLs that were tweeted
@JoaquimLey
JoaquimLey / create_new_ssh_key.md
Last active April 4, 2024 11:07
Generating a new SSH key and adding it to the ssh-agent

Generating a new ssh-key

Open Terminal. Paste the text below, substituting in your GitHub email address.

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

This creates a new ssh key, using the provided email as a label

Generating public/private rsa key pair.

@zenorocha
zenorocha / etc-hosts-on-win.md
Last active April 11, 2024 23:07
/etc/hosts on Windows

1. Get your IP Address

echo `ifconfig $(netstat -nr | grep -e default -e "^0\.0\.0\.0" | head -1 | awk '{print $NF}') | grep -e "inet " | sed -e 's/.*inet //' -e 's/ .*//' -e 's/.*\://'`

2. Modify your hosts file

notepad