Skip to content

Instantly share code, notes, and snippets.

View maxdevjs's full-sized avatar
💭
╯︵ ┻━┻

maxdevjs maxdevjs

💭
╯︵ ┻━┻
View GitHub Profile
@maxdevjs
maxdevjs / env-examples.md
Created October 30, 2022 03:25 — forked from ericelliott/env-examples.md
env-examples

Most configuration really isn't about the app -- it's about where the app runs, what keys it needs to communicate with third party API's, the db password and username, etc... They're just deployment details -- and there are lots of tools to help manage environment variables -- not the least handy being a simple .env file with all your settings. Simply source the appropriate env before you launch the app in the given env (you could make it part of a launch script, for instance).

env files look like this:

SOMEVAR="somevalue"
ANOTHERVAR="anothervalue"

To source it:

$ source dev.env # or staging.env, or production.env, depending on where you're deploying to

@maxdevjs
maxdevjs / linux-full-desktop-container.md
Created July 9, 2022 18:35 — forked from morrolinux/linux-full-desktop-container.md
Run a full linux desktop in a container

In the following gist I'm going to guide you through the process of installing and booting an entire linux distribution with full desktop environment just like you would have with a classical VM, but with much better performance and much worse isolation :)

The reason why I did this was mainly because it's cool, but also to test new distros with decent graphics performance without actually booting them on my PC.

If you "try this at home" just keep in mind a container is not as secure as a VM, and some of the option we're going to explore will weaken container isolation from "a bit risky" to "totally unsafe" depending on what you choose.

Also, we're going to use systemd-nspawn for containers as it's probably the best fit for our use case and can also boot any linux partition without needing to prepare an apposite container image.

Less go!

@maxdevjs
maxdevjs / gh-something
Created October 31, 2021 06:32
Possible cheap alternative to check if on non FHS compliant systems. Based on https://github.com/samcoe/gh-repo-explore
#!/usr/bin/env bash
set -e
tag="v0.0.4"
repo="samcoe/gh-repo-explore"
extension_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
tag_path="${extension_path}/dist/${tag}"
exe="gh-repo-explore"
platform=""
extension=""
@maxdevjs
maxdevjs / todo.py
Created September 26, 2021 08:42 — forked from ForgottenProgramme/todo.py
Todo Manager CLI tool (Python) Mahe Iram Khan
#!/usr/bin/env python
import sys
from datetime import datetime
HELP_MESSAGE = """/
Usage :-
$ ./todo add "todo item" # Add a new todo
$ ./todo ls # Show remaining todos
$ ./todo del NUMBER # Delete a todo
$ ./todo done NUMBER # Complete a todo
$ ./todo help # Show usage
@maxdevjs
maxdevjs / setup
Created July 27, 2021 16:19 — forked from ejpcmac/setup
Setup script for Phoenix projects using Nix and PostgreSQL
#!/bin/sh
echo
if [ ! -d "deps" ] || [ ! "$(ls -A deps)" ]; then
printf "\e[32m=> Fetching dependencies and building the application...\e[0m\n\n"
echo "+ mix do deps.get, compile --verbose"
mix do deps.get, compile --verbose
echo
fi
@maxdevjs
maxdevjs / 00-error.md
Last active June 13, 2021 06:05
NixOS - error: getting attributes of path... : No such file or directorych file or directory

I started to consistently use NixOS and then plasma5+i3-xsession. In the last few weeks it froze three times, forcing to hard reboot each time.

Not sure it'd happen only with plasma5+i3-xsession, it just never happened with kde/plasma and with stand-alone i3 session.

Note: I added the unstable channel for a few programs, but the freezing already happened before it.

I managed to fix(?) several error: getting attributes of path:

var emojis = [
'😄','😃','😀','😊','☺','😉','😍','😘','😚','😗','😙','😜','😝','😛','😳','😁','😔','😌','😒','😞','😣','😢','😂','😭','😪','😥','😰','😅','😓','😩','😫','😨','😱','😠','😡','😤','😖','😆','😋','😷','😎','😴','😵','😲','😟','😦','😧','😈','👿','😮','😬','😐','😕','😯','😶','😇','😏','😑','👲','👳','👮','👷','💂','👶','👦','👧','👨','👩','👴','👵','👱','👼','👸','😺','😸','😻','😽','😼','🙀','😿','😹','😾','👹','👺','🙈','🙉','🙊','💀','👽','💩','🔥','✨','🌟','💫','💥','💢','💦','💧','💤','💨','👂','👀','👃','👅','👄','👍','👎','👌','👊','✊','✌','👋','✋','👐','👆','👇','👉','👈','🙌','🙏','☝','👏','💪','🚶','🏃','💃','👫','👪','👬','👭','💏','💑','👯','🙆','🙅','💁','🙋','💆','💇','💅','👰','🙎','🙍','🙇','🎩','👑','👒','👟','👞','👡','👠','👢','👕','👔','👚','👗','🎽','👖','👘','👙','💼','👜','👝','👛','👓','🎀','🌂','💄','💛','💙','💜','💚','❤','💔','💗','💓','💕','💖','💞','💘','💌','💋','💍','💎','👤','👥','💬','👣','💭','🐶','🐺','🐱','🐭','🐹','🐰','🐸','🐯','🐨','🐻','🐷','🐽','🐮','🐗','🐵','🐒','🐴','🐑','🐘','🐼','🐧','🐦','🐤','🐥','🐣','🐔','🐍','🐢','🐛','🐝','🐜','🐞','🐌','🐙','🐚','🐠','🐟','🐬','🐳','🐋','🐄','🐏','🐀','🐃','🐅','🐇','🐉','🐎','🐐','🐓','🐕','🐖','🐁','🐂','🐲','🐡','🐊','🐫','🐪','🐆','🐈','🐩','🐾',
@maxdevjs
maxdevjs / README.md
Last active February 28, 2020 04:05
Guix - Kitty - Error - Thu 27 Feb 2020 11:14:08 PM -03
@maxdevjs
maxdevjs / workstationsetup.sh
Created February 24, 2020 07:01 — forked from JeremyMorgan/workstationsetup.sh
Setup for my FreeBSD Workstation
# This may be runnable as a script, but keep in mind -y is not always acknowledged.
# These are the drop dead basics
pkg -y install vim
pkg -y install git
pkg -y install chromium
pkg -y install gimp
pkg -y install sudo
# Install Rust
@maxdevjs
maxdevjs / gist:4856e68ff010f129b149eec955a6f730
Created February 5, 2020 20:26 — forked from Kardelio/gist:c6a01e1e927a75ef7f3af44ef79e7e35
Interactive Git Branch changer using fzf
git branch | fzf | sed 's/\* //g' | xargs -I '{}' git checkout {}