Skip to content

Instantly share code, notes, and snippets.

Avatar

Justin Force e0da

View GitHub Profile
@e0da
e0da / README.md
Last active Sep 16, 2020
Prompts
View README.md

e0da prompt

e0da prompt example

.zshrc goes in $HOME, everything else goes in $HOME/share, and you want to brew install zsh-git-prompt. I'm using Gruvbox here with macOS Terminal.

@tankerkiller125
tankerkiller125 / firefox-developer.desktop
Created Feb 24, 2018
UMake Firefox Developer Edition, Touch Support, Actions Support
View firefox-developer.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=Firefox Developer Edition
Icon=/home/matthew/.local/share/umake/web/firefox-dev/browser/chrome/icons/default/default128.png
TryExec=/home/matthew/.local/share/umake/web/firefox-dev/firefox
Exec=env MOZ_USE_XINPUT2=1 firefox-developer
Comment=Firefox Aurora with Developer tools
Categories=Development;IDE;Network;WebBrowser;
Terminal=false
@chenxiaolong
chenxiaolong / DellXPS15_9560_AHCI_RAID.md
Created Nov 27, 2017
Switching between AHCI and RAID on the Dell XPS 15 (9560)
View DellXPS15_9560_AHCI_RAID.md

Switching between AHCI and RAID on the Dell XPS 15 (9560)

This guide likely applies to other models and, potentially, even laptops from other OEMs that have NVME drives. However, I've only tested this on my Dell XPS 15 (9560) with the OEM Windows installation from the Signature Edition model.

Switching from RAID to AHCI

Switching from RAID to AHCI is significantly simpler than switching from AHCI to RAID. All that's needed is a successful boot to Safe Mode.

  1. To set the default boot mode to Safe Mode, use msconfig.exe or open an admin cmd/PowerShell window and run:
View AWS access key grep
url - https://aws.amazon.com/blogs/security/a-safer-way-to-distribute-aws-credentials-to-ec2/
Finding hard-coded credentials in your code
Hopefully you’re excited about deploying credentials to EC2 that are automatically rotated. Now that you’re using Roles, a good security practice would be to go through your code and remove any references to AKID/Secret. We suggest running the following regular expressions against your code base:
Search for access key IDs: (?<![A-Z0-9])[A-Z0-9]{20}(?![A-Z0-9]). In English, this regular expression says: Find me 20-character, uppercase, alphanumeric strings that don’t have any uppercase, alphanumeric characters immediately before or after.
Search for secret access keys: (?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=]). In English, this regular expression says: Find me 40-character, base-64 strings that don’t have any base 64 characters immediately before or after.
If grep is your preferred tool, run a recursive, Perl-compatible search using the following commands
View swapesc
#!/bin/bash
current=$(dconf read /org/gnome/desktop/input-sources/xkb-options)
swapped="['caps:swapescape']"
capslock="['caps:capslock']"
echo "Current status: $current"
if [ "$current" == "$swapped" ]
then
echo "Making caps and escape WORK NORMALLY"
@ShPakvel
ShPakvel / general_helper.rb
Created Oct 15, 2014
Grape permitted_params helper. It works the same as Rails strong params. Only params defined in params block will remain.
View general_helper.rb
module GeneralHelper
def permitted_params
@permitted_params ||= declared(params, include_missing: false)
end
end
@lonetwin
lonetwin / Git dot files management
Last active Jun 17, 2020
A simple way to manage dotfiles with git without silly symlinks and special tools. Just use negative matches in your .gitignore !
View Git dot files management
I like to manage dotfiles without having to mess with silly symlinks or having
to install/configure specific dotfile managament tools. So here's what I did:
$ cd ~
$ git init .
$ echo '*' > .gitignore # ignore all files by default
$ echo '!.bashrc' >> .gitignore # ...and then tell git what files not to *not* ignore
$ # ...add other files you may want to track to *not* ignore
$ git add .bashrc # now actually add the files to git
$ git add .gitignore # add the .gitignore to git
@LeahCim
LeahCim / 25_pre-os-prober
Created Mar 3, 2014
In Ubuntu, /etc/grub.d/30_os-prober overrides grub menu style and timeout defined by the user in /etc/default/grub. Here is a workaround to save the menu style and timeout values before os-prober changes them, and to restore them afterwards. The two files need to be placed under /etc/grub.d and made executable. Finally, "sudo update-grub" should…
View 25_pre-os-prober
#! /bin/sh
set -e
# Save the $timeout and $timeout_style values set by /etc/grub.d/00_header
# before /etc/grub.d/30_os-prober messes them up.
cat << EOF
set timeout_bak=\${timeout}
set timeout_style_bak=\${timeout_style}
EOF
@namuol
namuol / INSTALL.md
Last active Oct 22, 2020
rage-quit support for bash
View INSTALL.md

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

@OpenNingia
OpenNingia / terminal_color_scheme
Last active Jul 27, 2017
Simple script to apply Solarized color scheme to Pantheon Terminal
View terminal_color_scheme
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Solarized theme for pantheon-terminal
see http://ethanschoonover.com/solarized
"""
import posixpath
import sys
from gi.repository import Gio
You can’t perform that action at this time.