Skip to content

Instantly share code, notes, and snippets.

@yasenn
yasenn / NginxRedirect.md
Created September 25, 2020 20:55 — forked from esfand/NginxRedirect.md
Nginx Redirect

Redirect: Temporary and Permanent

Source

What is an HTTP Redirect?

HTTP redirection, or URL redirection, is a technique of pointing one domain or address to another. There are many uses for redirection, and a few different kinds of redirection to consider.

As you create content and administrate servers, you will often find the need to redirect traffic from one place to another. This guide will discuss the different use-cases for these techniques, and how to accomplish them in Apache and Nginx.

@yasenn
yasenn / proc_net_tcp_decode
Created March 22, 2019 12:39 — forked from jkstill/proc_net_tcp_decode
decode entries in /proc/net/tcp
Decoding the data in /proc/net/tcp:
Linux 5.x /proc/net/tcp
Linux 6.x /proc/PID/net/tcp
Given a socket:
$ ls -l /proc/24784/fd/11
lrwx------ 1 jkstill dba 64 Dec 4 16:22 /proc/24784/fd/11 -> socket:[15907701]

some tools for diagrams in software documentation

Diagrams For Documentation

Obvious Choices

ASCII

@yasenn
yasenn / docker_cleanup.sh
Created January 6, 2018 16:10 — forked from Jamesits/docker_cleanup.sh
Docker cleanup unused things
#!/usr/bin/env bash
# USE WITH CAUTION
# remove all exited containers
docker rm $(docker ps -a -f status=exited -f status=created -q)
# remove dangling volumes
docker volume rm $(docker volume ls -f dangling=true -q)
@yasenn
yasenn / slackpost
Created September 4, 2017 12:52 — forked from dopiaza/slackpost
Post a message to a Slack channel
#!/bin/bash
# Usage: slackpost <token> <channel> <message>
# Enter the name of your slack host here - the thing that appears in your URL:
# https://slackhost.slack.com/
slackhost=PUT_YOUR_HOST_HERE
token=$1
@yasenn
yasenn / nginx.conf
Created October 18, 2016 20:49
nginx-2016.conf
### Nginx main config: Tweaks & SSL settings (without the FastCGI-cache config parts)
## http {} block:
http {
# [...]
server_tokens off;
reset_timedout_connection on;
@yasenn
yasenn / html_email_buttons_1.html
Created March 18, 2016 15:47 — forked from elidickinson/html_email_buttons_1.html
HTML email buttons that work
<div>
<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="http://www.EXAMPLE.com/" style="height:40px;v-text-anchor:middle;width:300px;" arcsize="10%" stroke="f" fillcolor="#d62828">
<w:anchorlock/>
<center style="color:#ffffff;font-family:sans-serif;font-size:16px;font-weight:bold;">
Button Text Here!
</center>
</v:roundrect>
<![endif]-->
<![if !mso]>
@yasenn
yasenn / .htaccess
Created March 4, 2016 05:41 — forked from Zodiac1978/.htaccess
Make WordPress faster - a safe htaccess way
#
# Sources:
# http://stackoverflow.com/questions/7704624/how-can-i-use-gzip-compression-for-css-and-js-files-on-my-websites
# http://codex.wordpress.org/Output_Compression
# http://www.perun.net/2009/06/06/wordpress-websites-beschleuinigen-4-ein-zwischenergebnis/#comment-61086
# http://www.smashingmagazine.com/smashing-book-1/performance-optimization-for-websites-part-2-of-2/
# http://gtmetrix.com/configure-entity-tags-etags.html
# http://de.slideshare.net/walterebert/die-htaccessrichtignutzenwchh2014
# http://de.slideshare.net/walterebert/mehr-performance-fr-wordpress
#
@yasenn
yasenn / solarized.bash
Created February 17, 2016 19:44 — forked from kraft001/solarized.bash
solarized Gnome Terminal + Tmux + Vim
# store all solarized files in one place
mkdir ~/.solarized
cd ~/.solarized
# http://www.webupd8.org/2011/04/solarized-must-have-color-paletter-for.html
git clone https://github.com/seebi/dircolors-solarized.git
eval `dircolors ~/.solarized/dircolors-solarized/dircolors.256dark`
ln -s ~/.solarized/dircolors-solarized/dircolors.256dark ~/.dir_colors
git clone https://github.com/sigurdga/gnome-terminal-colors-solarized.git