Skip to content

Instantly share code, notes, and snippets.

View FossilBlade's full-sized avatar
🦥
I may be slow to respond.

FossilBlade

🦥
I may be slow to respond.
View GitHub Profile
# Creating an empty dictionary
data = {}
# OR
data = dict()
# Creating a dictionary with initial values
data = {'a':1,'b':2,'c':3}
# OR
data = dict(a=1, b=2, c=3)
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel
readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
DELETE TAG FROM REGISTRY
See: https://github.com/docker/distribution/blob/master/docs/spec/api.md#deleting-an-image
Working usage: https://github.com/byrnedo/docker-reg-tool
Stackoverflow: https://stackoverflow.com/questions/25436742/how-to-delete-images-from-a-private-docker-registry
@FossilBlade
FossilBlade / README.md
Created September 18, 2019 09:49 — forked from developius/README.md
Setup SSH keys for use with GitHub/GitLab/BitBucket etc

Create a new repository, or reuse an existing one.

Generate a new SSH key:

ssh-keygen -t rsa -C "your_email@example.com"

Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings.

Test SSH key:

Here is a working example via aws-cli and jq.
Preparation
Create S3 bucket:
aws s3 mb s3://wei20181202s3
make_bucket: wei20181202s3
Create SNS topic:
aws sns create-topic --name wei20181202sns
{

Mounting VirtualBox shared folders on Ubuntu Server 18.04 LTS (Bionic Beaver)

This guide will walk you through the steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest.

Prerequisites

This guide assumes that you are using the following setup:

You could still make this guide work with other setups (possibly with some modifications to the commands and whatnot).

@FossilBlade
FossilBlade / Git _Credential _Cache.md
Last active May 9, 2020 08:12
Git Credential Cache

Configuring git-credential-cache on Linux

git-credential-cache is a useful tool to remember your HTTP/HTTPS git credentials (though you really should be using SSH instead). It’s useful when using long passwords or access tokens. It stores them in memory for a specific amount of time.

Enabling it

$ git config --global credential.helper cache

Setting the timeout

$ git config --global credential.helper 'cache --timeout=600'

Disabling it

$ git config --global --unset credential.helper

@FossilBlade
FossilBlade / gitignore_effect.md
Last active May 13, 2020 06:46
Untrack files already added to git repository based on .gitignore

Step 1: Commit all your changes

Before proceeding, make sure all your changes are committed, including your .gitignore file.

Step 2: Remove everything from the repository

To clear your repo, use:

git rm -r --cached .

rm is the remove command -r will allow recursive removal

@FossilBlade
FossilBlade / example.com
Created May 15, 2020 13:36 — forked from 1hakr/example.com
Supercharge your NGIX config
proxy_cache_path /tmp/cacheapi levels=1:2 keys_zone=microcacheapi:100m max_size=1g inactive=1d use_temp_path=off;
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name example.com;
location /api/ {
# Rate Limiting
limit_req zone=reqlimit burst=20; # Max burst of request

MySQL Download URL

https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.56-linux-glibc2.5-x86_64.tar.gz

Open the terminal and follow along:

  • Uninstall any existing version of MySQL
sudo rm /var/lib/mysql/ -R