Skip to content

Instantly share code, notes, and snippets.

@nepsilon
nepsilon / how-to-secure-your-site-with-https.md
Last active August 9, 2018 11:19
How to secure your site with HTTPS? — First published in fullweb.io issue #101

How to secure your site with HTTPS?

With HTTP everything is visible when traveling on the Internet. By generating an SSL certificate and configuring your webserver you can force browsers to use HTTPS. Here is how to proceed:

# 1. Install letsencrypt
sudo pip install letsencrypt
@nepsilon
nepsilon / pruning-your-bash-history-for-a-better-search-experience.md
Created April 5, 2017 05:56
Pruning your Bash history for a better search experience — First published in fullweb.io issue #94

Pruning your Bash history for a better Ctrl+R experience

If you are accustomed (like me) to fire Ctrl+R before running any new command, here is a tip to keep your Shell history clean and more search-friendly.

The best way to do this is to prevent some commands (e.g. those with passwords inlined) to be logged, but also to skip saving duplicated commands.

This is all controlled by the environment variable HISTCONTROL. It can take 3 values:

  • ignorespace: lines which begin with a space character are not saved
  • ignoredups: lines matching the previous history entry are not saved
  • ignoreboth: is shorthand for ignorespace and ignoredups

Kafka installation with systemd

0. Create kafka user

sudo adduser kafka
sudo adduser kafka sudo
su -l kafka

1. Download and Install kafka archive

@ficapy
ficapy / file_transfer.py
Last active November 16, 2015 15:55
CDN文件中转
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Ficapy
from __future__ import division, print_function
import sys
import re
import urllib
import sqlite3
import tempfile
@pablitoc
pablitoc / configure_proxy_protocol.md
Last active April 12, 2023 15:21
Configuring Proxy Protocol

##Install AWS CLI Tools##

  1. Install AWS CLI Tools. You can also use the EC2 API Tool if you are more comfortable with them. But this write-up uses the EC2 CLI.
  2. Create a user via Amazon IAM or download the security accessID and securitykey you will need it to query Amazon CLI.
  3. using Terminal cd into .aws directory cd ~/.aws edit or create new file named config paste the following contents inside.
    `[default]`
    `aws_access_key_id = ACCESS_ID`
    `aws_secret_access_key = SECRET_ID`
    `output = json OR bson OR text`
    `region = PREFERRED_AWS_REGION`

Save the file as "config"