Skip to content

Instantly share code, notes, and snippets.

@diego09310
diego09310 / toggleBacklight.sh
Last active February 20, 2021 02:09
Script to toggle the screen backlight on and off in Linux
#!/bin/bash
#
# Toggles on and off the screen backlight
#
# It saves the current brightness value, if there is no previous value,
# defaults to 1/10th of max brightness
#
# More information in https://diego09310.github.io/linux/2020/02/19/turn-off-dell-xps-screen-linux.html
#
@diego09310
diego09310 / moon.py
Created June 20, 2020 00:11
Script to generate the actual moon phase based on NASA data about the moon
#!/bin/env python
import json
import datetime
INPUT_FILE = "moon_all.json"
OUTPUT_FILE = "moon_formatted.json"
NEW_MOON = "new_moon"
WAX_CRES = "waxing_crescent"
#!/bin/bash
sudo apt-get -y update && sudo apt-get -y upgrade
sudo apt-get install -y \
zsh \
git \
neovim \
tmux
@diego09310
diego09310 / .aliases
Last active April 13, 2020 00:47
Personal aliases
#!/bin/bash
# git
alias gp='git pull'
alias gh='git push'
alias ghu='git push -u'
alias ghoh='ghu origin HEAD'
alias ga='git add'
alias gaa='git add -u'
alias gaaa='git add .'
@diego09310
diego09310 / Eclipse Dark.icls
Created July 18, 2018 20:03
Color scheme for IntelliJ based on the Eclipse Dark theme
<scheme name="Dark Eclipse" version="142" parent_scheme="Darcula">
<metaInfo>
<property name="created">2017-09-13T17:42:50</property>
<property name="ide">Idea</property>
<property name="ideVersion">2017.2.4.0.0</property>
<property name="modified">2018-07-18T14:49:20</property>
<property name="originalScheme">_@user_Darcula</property>
</metaInfo>
<colors>
<option name="CONSOLE_BACKGROUND_KEY" value="292929" />
@diego09310
diego09310 / cat_mode.sh
Created April 29, 2018 05:58
Disable input devices in Linux
#!/bin/bash
#
# Shell script to disable (and reenable) the keyboard and the touchpad.
# I use it when cats are around and I can work with a wireless keyboard/mouse.
# To use it, execute "xinput list" to print the list of input devices and add
# the id and the master it belongs (number in parenthesis) to the id and
# master arrays.
# "./cat_mode.sh [on]" disables the configured devices
# "./cat_mode.sh off" (off or anything else) reenables the devices
#