tmux shortcuts & cheatsheet
start new:
tmux
start new with session name:
tmux new -s myname
start new:
tmux
start new with session name:
tmux new -s myname
#!/usr/bin/env bash | |
# To fix the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error | |
# Make sure that the .gnupg directory and its contents is accessibile by your user. | |
chown -R $(whoami) ~/.gnupg/ | |
# Also correct the permissions and access rights on the directory | |
chmod 600 ~/.gnupg/* | |
chmod 700 ~/.gnupg |
This is a technique for extracting all imported modules from a packaged Python application as .pyc
files, then decompiling them. The target program needs to be run from scratch, but no debugging symbols are necessary (assuming an unmodified build of Python is being used).
This was originally performed on 64-bit Linux with a Python 3.6 target. The Python scripts have since been updated to handle pyc files for Python 2.7 - 3.9.
In Python we can leverage the fact that any module import involving a .py*
file will eventually arrive as ready-to-execute Python code object at this function:
PyObject* PyEval_EvalCode(PyObject *co, PyObject *globals, PyObject *locals);
Install OS X El Capitan
is created# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/dhparam.pem 2048 |
MCCI needs OpenSSL for a Windows project (that will be cross-platform). A casual search didn't turn up either a good source for cross-platform libraries, which meant we have to build them ourselves. A deeper search found a detailed guide here, and yet the details don't match what I found when I checked out the code; and the post doesn't talk about doing it directly from GitHub (which I wanted to do).
Here's the procedure for building OpenSSL on 64-bit Windows 10, with Visual Studio 2015.
In the following, I'll use lines beginning with
{dir} $
to designate input to a bash Window. We'll also have to use acmd.exe
Window for much of the build, and those lines will be marked{dir}>
, just as on Windows..
ln -sf /usr/share/zoneinfo/$(tzselect) /etc/localtime | |
hwclock --systohc | |
nano /etc/locale.gen && locale-gen | |
read -p "Default LANG is? [en_US,zh_CN...]" loc | |
echo "LANG=$loc.UTF-8" >> /etc/locale.conf | |
read -p "Hostname is?" hn | |
echo $hc > /etc/hostname | |
echo "127.0.1.1\t$hc.localdomain\t$hc" > /etc/hosts |
#!/bin/bash | |
#check network connection | |
con=$(ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` > /dev/null && echo ok || echo error) | |
if [ $con == "error" ]; then | |
exit -1 | |
fi | |
timedatectl set-ntp true | |
lsblk |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Skip to the relevant sections if needed.