Skip to content

Instantly share code, notes, and snippets.

@maxivak
maxivak / _0__ssl_certbot_letsencrypt.md
Last active April 16, 2024 21:48
Let's encrypt SSL certificates using certbot in docker

Directories on host machine:

  • /data/certbot/letsencrypt

  • /data/certbot/www

  • Nginx server in docker container

docker run -d --name nginx \
@stvar
stvar / youtube-search.py
Last active June 20, 2023 14:23
Find YouTube channel IDs by custom URLs or user names
#!/usr/bin/python3
# Copyright (C) 2020 Stefan Vargyas
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@yokawasa
yokawasa / aks-cheat-sheet.md
Last active April 29, 2024 09:33
Azure Kubernetes Services Cheat Sheet
let NETWORK_PRESETS = {
'GPRS': {
'offline': false,
'downloadThroughput': 50 * 1024 / 8,
'uploadThroughput': 20 * 1024 / 8,
'latency': 500
},
'Regular2G': {
'offline': false,
'downloadThroughput': 250 * 1024 / 8,
@superjose
superjose / .gitlab-ci.yml
Last active February 19, 2024 10:22
This is an example of a .gitlab-ci.yml that is required for Continuous Integration on GitLab projects.
# Reference: https://www.exclamationlabs.com/blog/continuous-deployment-to-npm-using-gitlab-ci/
# GitLab uses docker in the background, so we need to specify the
# image versions. This is useful because we're freely to use
# multiple node versions to work with it. They come from the docker
# repo.
# Uses NodeJS V 9.4.0
image: node:9.4.0
# And to cache them as well.
@ipan
ipan / screen.md
Created January 18, 2018 00:48
screen or byobu scroll up and down #screen #byobu #scroll

scroll up and down

Ctrl-A [

This will activate copy mode in GNU/screen. Now, you can scroll up/down and look at your data. Use the following keys:

  1. Ctrl-u and Ctrl-d scroll the display up/down by the specified amount of lines while preserving the cursor position. (Default: half screen-full).
  2. Ctrl-b and Ctrl-f scroll the display up/down a full screen.
#!/bin/bash
#
# Docker Daemon varsayilan olarak ag iletisimi olmadan
# sadece Unix socket uzerinden calismaktadir.
# Docker Client ve Daemon arasinda HTTPS uzerinden
# guvenli iletisimin kurulmasi icin TLS aktif hale getirilmelidir.
# Client ve Server/daemon arasindaki guvenli iletisim agi
# icin gereken client ve server sertifikasyonlarini
# olusturmaliyiz.
#
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@brock
brock / psql-with-gzip-cheatsheet.sh
Last active April 10, 2024 10:53
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database
@marekdano
marekdano / todolist.jsx
Last active October 18, 2023 03:18
Simple Todo list app using React and ES6 with functions delete a todo and/or mark a todo as done
import React from 'react';
/*
Todo app structure
TodoApp
- TodoHeader
- TodoList
- TodoListItem #1
- TodoListItem #2