Skip to content

Instantly share code, notes, and snippets.

View elfosardo's full-sized avatar
🏃‍♂️
ruuuun

Riccardo Pittau elfosardo

🏃‍♂️
ruuuun
View GitHub Profile
@elfosardo
elfosardo / tmux_local_install.sh
Last active April 4, 2017 05:12 — forked from ryin/tmux_local_install.sh
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access or you want a different version.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# To install in a box with no external connection donwload the source files and put them in the temp_dir.
# TODO:
# manage local source files better
# exit on error
@elfosardo
elfosardo / python_convert_dict_to_list
Created March 10, 2018 16:13
[python] convert dictionary to list
# A list of the keys of dictionary
list_keys = [ k for k in dict ]
# or a list of the values
list_values = [ v for v in dict.values() ]
# or just a list of the list of key value pairs
list_key_value = [ [k,v] for k, v in dict.items() ]
@elfosardo
elfosardo / ubuntu_install
Last active May 29, 2018 13:22
ubuntu install
sudo apt install gnome-tweak-tool
# run gnome-tweaks
# change mouse/touchpad to use right button correctly
# change date/time
# remove icons from desktop
# customize ubuntu dock/dash
# reduce icon size
# remove icons from left bar
# if virtual-box, disable automatic screen lock and set blank screen to never
gsettings get org.gnome.desktop.screensaver lock-enabled
@elfosardo
elfosardo / podman_commands
Created May 26, 2020 10:00
podman commands
# Run a container and immediately enter a bash shell
podman run -it --entrypoint /bin/bash <image>
@elfosardo
elfosardo / python_one_liners.txt
Created July 28, 2020 08:09
Python one-liners
### Swapping the value of variables
# a->b
# b->a
a, b = b, a
# Works with more values
a, b, c, d = d, c, b, a
### List comprehension
# instead of: