Skip to content

Instantly share code, notes, and snippets.

View falexandrou's full-sized avatar

Fotis Alexandrou falexandrou

View GitHub Profile
@falexandrou
falexandrou / stackmate-sample.yml
Created March 29, 2022 20:17
Sample stackmate YAML file
---
# Basic configuration
name: awesome-nodejs-project # The project's name
provider: aws # Which cloud provider to use
region: eu-central-1 # The default region to deploy to
# Terraform state storage
state:
bucket: project-name # Use a private, encrypted S3 bucket to store the state
@falexandrou
falexandrou / docker-daemon.sh
Created April 14, 2021 23:18
Run docker daemon via SSH
# You can use a docker daemon via SSH
# Here's how you'd run a container via SSH
$ docker -H ssh://<username>:<server> -it alpine date
# For convenience, this can be aliased as follows:
# (I use rdocker — as in remote docker)
$ alias rdocker="docker -H myusername@myserver"
# Example:
$ rdocker run -it alpine date
with ThreadPoolExecutor(max_workers=os.cpu_count()) as executor:
futures = executor.map(process_func, plays)
for future in as_completed(futures, timeout=None):
failures += 1 if future.exception() else 0
executor.shutdown(wait=True)
@falexandrou
falexandrou / nginx.error.log
Created October 17, 2019 10:13
gremlin nginx.error.log
2019/10/15 09:53:18 [info] 27513#27513: *11173 epoll_wait() reported that client prematurely closed connection, so upstream connection is closed too while sending request to upstream, client: 87.203.202.157, server: gremlin.gr, request: "GET /rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBKdz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--7abbc1583ddcc70ffe7227afc6a6adc01bd6514d/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lNT0RBd2VEZ3dNQVk2QmtWVSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--a0d4840ae89f302d71bd86190481033bd87e685a/C21444_FW18_PureMove_Bra_Graphics_Pack_07_rgb_vbp__002-1255x742.jpg HTTP/1.1", upstream: "http://unix:///var/www/gremlin/shared/tmp/sockets/puma.sock:/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBKdz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--7abbc1583ddcc70ffe7227afc6a6adc01bd6514d/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lNT0RBd2VEZ3dNQVk2QmtWVSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--a0d4840ae89f302d71bd86190
@falexandrou
falexandrou / swap.sh
Created August 14, 2019 15:25
Create Swap Ubuntu 16.08
# How To Add Swap Space on Ubuntu 18.04
#
# Check out https://stackmate.io and find out how this (and much more) can be done automatically for you
# Before you run this script, please check that swap is not enabled with the following command:
# sudo swapon --show
# If it shows some output, then you probably don't need to run this script anymore
# We're allocating 8GB of swap
sudo fallocate -l 8G /swapfile
@falexandrou
falexandrou / varnish.php
Created May 7, 2018 14:23
varnish purge
<?php
/**
* Send data to Varnish
*
* @since 2.6.8
*
* @param string $url The URL to purge.
* @return void
*/
function rocket_varnish_http_purge( $url ) {
@falexandrou
falexandrou / keybase.md
Created April 25, 2018 16:55
keybase.md

Keybase proof

I hereby claim:

  • I am falexandrou on github.
  • I am falexandrou (https://keybase.io/falexandrou) on keybase.
  • I have a public key ASCkxsN8ltxAfUxD0WYm3WKADZ7aiVSq2up2MqF4stqKogo

To claim this, I am signing this object:

@falexandrou
falexandrou / crop.util.css
Created February 12, 2018 14:25
Tiny utility for cropping text via css
.crop {
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
[2017-11-13 13:00:03] production.DEBUG: now: 2017-11-13 13:00:03 start time 1: 2017-02-10 20:42:30 start time 2: 2017-02-10 21:12:30 [] []
[2017-11-13 13:00:03] production.DEBUG: now: 2017-11-13 13:00:03 end time 1: 2017-02-12 20:40:47 end time 2: 2017-02-12 21:10:47 [] []
[2017-11-13 13:00:03] production.DEBUG: Analyzing contest Siamo Alla Frutta [] []
[2017-11-13 13:00:03] production.DEBUG: now: 2017-11-13 13:00:03 start time 1: 2017-02-11 20:07:42 start time 2: 2017-02-11 20:37:42 [] []
[2017-11-13 13:00:03] production.DEBUG: now: 2017-11-13 13:00:03 end time 1: 2017-02-27 20:07:42 end time 2: 2017-02-27 20:37:42 [] []
[2017-11-13 13:00:03] production.DEBUG: Analyzing contest the beautiful contest ever [] []
[2017-11-13 13:00:03] production.DEBUG: now: 2017-11-13 13:00:03 start time 1: 2017-02-18 03:29:17 start time 2: 2017-02-18 03:59:17 [] []
[2017-11-13 13:00:03] production.DEBUG: now: 2017-11-13 13:00:03 end time 1: 2017-02-28 03:29:17 end time 2: 2017-02-28 03:59:17 [] []
[2017-11-13 13:00:03] product