Skip to content

Instantly share code, notes, and snippets.

View lym's full-sized avatar
🎾

salym lym

🎾
View GitHub Profile
@lym
lym / gist:89a1dd28a8ca27e87c68d3325e7b0be6
Created November 28, 2018 13:52
[Fix] Headless::Exception: Display socket is taken but lock file is missing - check the Headless troubleshooting guide
mkdir /tmp/.X11-unix && sudo chmod 1777 /tmp/.X11-unix && sudo chown root /tmp/.X11-unix/
@lym
lym / random_string_generator.rb
Created September 2, 2019 20:09 — forked from KamilLelonek/random_string_generator.rb
Ruby random string generator with particular length
class RandomStringGenerator
def without_numbers(length)
random_string(length, alphabet)
end
def with_numbers(length)
random_string(length, alphabet + numbers)
end
private
@lym
lym / secret-key-gen.py
Created September 23, 2020 14:30 — forked from ndarville/secret-key-gen.py
Generating a properly secure SECRET_KEY in Django
"""
Two things are wrong with Django's default `SECRET_KEY` system:
1. It is not random but pseudo-random
2. It saves and displays the SECRET_KEY in `settings.py`
This snippet
1. uses `SystemRandom()` instead to generate a random key
2. saves a local `secret.txt`
@lym
lym / git-conventions.md
Created December 10, 2021 17:40 — forked from mhartington/git-conventions.md
Git Conventions

You've been working locally for awhile. You're ready to push some changes, but someone else pushed something! You have to pull in their changes before you can push yours.

git pull origin master forces you to create a merge commit, which is annoying.

Instead, do git pull --rebase origin master. This will effectively:

  1. Stash your changes
  2. Pull in the changes from origin
  3. Apply your changes on top

No merge commit!