start new:
tmux
start new with session name:
tmux new -s myname
#!/bin/bash -ex | |
# | |
# configures wordpress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# script is aware of .git directories by default. edit if you need to consider | |
# other folders as well. | |
# | |
# you will find a log file in /tmp/ in case you fucked up. |
#!/bin/bash -e | |
# dpkgdump.sh | |
# creates text file with a list of all packages installed by date | |
TMP0=`mktemp "${TMPDIR:-/tmp}"/dpkgdump.col.XXXXXXXXXX` | |
TMP1=`mktemp "${TMPDIR:-/tmp}"/dpkgdump.res.XXXXXXXXXX` | |
# next append current log | |
find /var/log -maxdepth 1 -type f -regex ".*\dpkg\.log\.[0-9].gz$" | xargs zcat > $TMP0 |
#!/bin/sh | |
DATE=`date +%Y-%m-%d-d%` | |
ARCH=`uname -m` | |
HOSTNAME=`uname -n` | |
ROOTFS_TYPE=`df -T / | awk '{print $2}' | grep -v "Type"` | |
BACKUP_PATH=`pwd` | |
STAGE5NAME="backup-${ARCH}-${ROOTFS_TYPE}-${HOSTNAME}-${DATE}.tar.gz" | |
cd /; |
I've noticed on several occasions that even people who work on a computer a lot don't know about the Shell (a.k.a Terminal) on their machines. | |
The Shell is an incredibly powerful tool that can help you with a lot of tasks and operations in your everyday life. It can drastically improve your productivity, you can manage servers from it, crunch huge amounts of data (searching, sorting, filtering, replacing), it allows you to automate annoying tasks and so much more. | |
I experience a lot of confusion and insecurities about it's use. It's not remotely as scary as people perceive it to be. And that's where I want to help. | |
They say learning through experience is the best way to go about it. I want to invite you to an interactive workshop to play with the command line and learn some basics to get your way around it. Afterwards you will be able to incorporate it's use into your workflow. | |
This session is not for hackers and developers only. I invite everyone who is curious about it and wants to feel like a ninja. |
#!/bin/bash | |
set -e | |
# VARIABLES | |
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
project=`uname -n` | |
backup_dir=`mktemp -d "${TMPDIR:-/tmp}"/${project}.backup.XXXX` | |
today=`date +'%Y-%m-%d'` | |
at="at `echo $(date)`" | |
backup_log=/var/log/backup-website.log |
vim updater.bash | |
bash updater.bash | |
vim updater.bash | |
apt-cache search gem | |
sudo gem install -V lolcat | |
cowthink heyhey | |
sudo apt-get install fortune | |
fortune | |
man fortune | |
fortune -o |
This is a copy of https://github.com/Jay-Oh-eN/datasets
#!/usr/bin/env python3 | |
# Translates IPv4/6 CIDR blocks into a list of IPs and writes | |
# them into a text file. Requires netaddr (pip install netaddr). | |
import netaddr | |
ip_list = netaddr.IPNetwork('192.168.1.0/21') | |
with open('ips-from-cidr.txt', 'w') as f: | |
for ip in ip_list: |