When you start a clean Linode, it isn't secured in the following aspects:
- Allows root SSH login
- Uses password authentication on SSH
- Doesn't have a firewall
| const assert = require('assert'); | |
| const _ = require('lodash'); | |
| const ensureJSONEncodable = (obj, path = null, visited = null) => { | |
| if (obj === null || _.isBoolean(obj) || _.isNumber(obj) || _.isString(obj)) { | |
| return; | |
| } | |
| path = path || []; |
| import os | |
| from io import BytesIO | |
| import boto3 | |
| BUCKET = 'bucket-name' | |
| def gen_int(): | |
| a = 0 |
If you need a good way to secure your Django admin site (e.g., http://example.com/admin/), this is it.
Reference: https://gist.github.com/mtigas/952344
Two months ago, I published an open source project, which went viral by gaining 1200+ stars in the first 24 hours. As of this writing, it has attracted 5000+ stars. The project is called HTTP Prompt:
https://github.com/eliangcs/http-prompt
Here I want to share its development story.
It all began with Vertica. Not long ago, I used Vertica every day for my work. Vertica is a powerful database, but the official client (vsql) is not powerful at all. The GUI alternative, DbVisualizer, is bad as well.
| """ | |
| A minimal web server that runs shell commands, powered by Tornado and its | |
| Subprocess module. It does non-blocking IO and streams the response. | |
| To start the server: | |
| $ python tornado_subprocess.py | |
| To send a shell command using httpie: |
| httplogger() { | |
| while true; do | |
| echo -e "HTTP/1.1 200 OK\r\n\r\nok" | nc -vl 8989 | |
| test $? -gt 128 && break | |
| echo | |
| echo '----------------------------------------' | |
| done | |
| echo | |
| } |
| sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" > /etc/apt/sources.list.d/pgdg.list' | |
| wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
| sudo apt-get update | |
| sudo apt-get upgrade | |
| # sudo apt-get install postgresql-9.3 | |
| # sudo apt-get install postgresql-client-9.3 |
| #!/Users/YOUR_USERNAME/.pyenv/versions/3.6.2/envs/alfred/bin/python | |
| import functools | |
| import json | |
| import os | |
| from datetime import datetime | |
| from threading import Thread | |
| import requests |