Skip to content

Instantly share code, notes, and snippets.

@darioseidl
darioseidl / aws-shortcuts-bookmarklet.html
Created September 7, 2020 09:44
AWS management console shortcuts bookmarklet
// The AWS management console shortcuts are stored in a cookie.
// This bookmarklet can be used to (re-)create the cookie.
// https://forums.aws.amazon.com/message.jspa?messageID=883519
javascript:var s="eb,ec2,ecr,rds,r53,s3,ses,iam"; var m = "tm-icon"; var c=document.cookie.replace(/(?:(?:^|.*;\s*)noflush_awscnm\s*\=\s*([^;]*).*$)|^.*$/, "$1"); if (!c) { alert("Can't find cookie. Wrong domain?"); } else { var awscnm=JSON.parse(decodeURIComponent(c)); awscnm.sc = s.split(","); awscnm.toolbarMode = m; document.cookie = `noflush_awscnm=${encodeURIComponent(JSON.stringify(awscnm))};domain=.console.aws.amazon.com;path=/`; alert(`Restored: ${awscnm.sc}`);} void(0);
@darioseidl
darioseidl / maintenance.md
Last active October 8, 2020 20:55
Some useful commands for Debian administration

Doing something important on the server:

Restoring a mysqldump:

mysql < mysqldump.sql

When restoring a dump of all tables from a different machine (e.g. using a dump from the production server on the VM), this will override the debian-sys-maint user (as well as other users and passwords).

@darioseidl
darioseidl / misc.md
Last active September 7, 2020 09:03
Some useful shell commands and tools

Remove .txt extension from all files in working directory

for f in $(ls); do move $f ${f%.txt}; done

Add .txt extension to all files in working directory

for f in $(ls); do move "$f" "${f}.txt"; done

Get first non-empty line in $f

@darioseidl
darioseidl / document.tex
Created March 26, 2016 17:09
LaTeX macros
%== setup ======================================================================
% be strict
\RequirePackage[l2tabu, orthodox]{nag}
% document class
\documentclass[a4paper,10pt,titlepage,final]{article}
% bug fixes
\usepackage{fixltx2e}