Skip to content

Instantly share code, notes, and snippets.

@MarcelFox
MarcelFox / agenda.sh
Last active March 15, 2023 13:07
bash function for agenda
function agenda() {
DIR_PATH="$HOME/.agenda"
if [ ! -d $DIR_PATH ]; then
mkdir $DIR_PATH
fi
if [ -z "$1" ]
then
if [ ! -f "$DIR_PATH/agenda.txt" ];
then
@MarcelFox
MarcelFox / format_flash_disk.sh
Last active January 17, 2018 21:59
format_flash_disk.sh
#!/bin/bash
# It formats interactively your last_attached flash_disk.
#
# WARNING: It's under construction, this is the first working script
# There may be issues and improvements to be made. Any help will be appreciated.
#
# By MarcelFox
last_flash_disk=$(sudo dmesg -T | grep removable | tail -n1 | awk '{print $8"1"}' | sed 's/\[//g; s/\]//g')
@MarcelFox
MarcelFox / .emacs
Last active March 15, 2023 13:06
Personal .emacs file
;; inhibit-startup-echo-area-message MUST be set to a hardcoded
;; string of your login name
;; Disable slash screen:
(setq inhibit-splash-screen t)
;; Set global text-mode and activate auto-fill:
(setq-default major-mode 'text-mode)
(setq-default auto-fill-function 'do-auto-fill)
@MarcelFox
MarcelFox / passgen.py
Last active February 13, 2018 13:56
Python Pass Generator
import os, random, string
length = 10
chars = string.ascii_letters + string.digits + '!@#$%^&*()'
o_chars = '!@#$%^&*()'
random.seed = (os.urandom(1024))
print (random.choice(o_chars) + ''.join(random.choice(chars) for i in range(length)) + random.choice(o_chars))
@MarcelFox
MarcelFox / check_conn.sh
Last active February 16, 2018 10:46
Check connection and IPs of a host.
#!/bin/bash
status_conn=$(wget -q --spider http://google.com && echo 0 || echo 1)
if [ $status_conn -eq 1 ]
then
printf "\n \e[36m Your Internet is pretty much dead!\n Check your networks...\e[0m\n\n";
elif [ $status_conn -eq 0 ]
then
external=$(dig +short myip.opendns.com @resolver1.opendns.com);
@MarcelFox
MarcelFox / 01_postfix_installer.md
Last active December 17, 2020 20:40 — forked from solusipse/01_postfix_installer.md
Postfix + Dovecot + Postgresql + Postfixadmin + Roundcube + Opendkim

Postfix Installer

Following script may be used for configuring complete and secure email server on fresh install of Debian 9. It will probably work on other distributions using apt-get. After minor changes you'll be able to use it on other Linux distros.

What it does?

02_postfix.sh:

  • Install Postfix and configure it with TLS support.
  • Install Dovecot and configure it's transport on Postfix.
  • Download, extract and correct permissions for Postfixadmin.
  • Download, extract and correct permissions for Roundcube.