Skip to content

Instantly share code, notes, and snippets.

@ljay79
ljay79 / iata-airport_codes.json
Last active January 23, 2024 21:11
IATA Airport codes as JSON array - sources from https://ourairports.com/data/ - @202401
This file has been truncated, but you can view the full file.
[
{
"id": 4983,
"name": "Anaa Airport",
"latitude_deg": -173.526,
"longitude_deg": "-145.509.995",
"continent": "OC",
"iso_country": "PF",
"iso_region": "PF-U-A",
"municipality": "Anaa",
@ljay79
ljay79 / redis-cli-install-amazonlinux
Last active July 13, 2020 09:29
redis-cli install on amazon linux 2 including deps
https://gist.github.com/todgru/14768fb2d8a82ab3f436#gistcomment-2189155
```
sudo yum install -y gcc
wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz
cd deps
make hiredis jemalloc linenoise lua geohash-int
cd ..
make install
sudo cp src/redis-cli /usr/bin/
@ljay79
ljay79 / mirror_website.sh
Last active January 18, 2019 14:47
Creating a local mirror of online website
wget -mpckE -rH --level=2 --convert-links -D[comma list of domains to include;example.org] \
-P ./backup/ --user-agent="" -e robots=off --wait 2 \
--restrict-file-names=ascii,windows \
https://www.example.org/
@ljay79
ljay79 / shell_delete_unused_images.php
Last active January 18, 2019 09:38 — forked from aleron75/shell_delete_unused_images
Delete no more used Product Images on Magento 1.x - tested on Magento CE v1.9.3.10
<?php
require_once 'abstract.php';
class Mage_Shell_CheckImages extends Mage_Shell_Abstract
{
const CATALOG_PRODUCT = '/catalog/product';
const CACHE = '/cache/';
const PLACEHOLDER = '/placeholder/';
#! /bin/bash
#
# General docker cleanup. Handy if you've been ahcking and need the
# accumulated juk to be blown away. Use at your own risk.
#
# First, remove the non-running containers.
# docker rm $(docker ps -aq -f "status=exited")
TAINERS=`docker ps -aq -f "status=exited" -f "status=dead"`
if test x"$TAINERS" != x; then
echo -n 'Removing exited containers...'
@ljay79
ljay79 / docker-dev-setup.txt
Created June 14, 2018 21:36
Notes: Docker - setup local development environment - for later reproducing
Developer Environment Setup - local
---------------------------------------------
Pre-Requisite:
- windows 10 pro localhost workstation
- WSL installed (with Ubuntu)
- "Docker for Windows" installed
- Bitbucket account with SSH keys
------------
@ljay79
ljay79 / docker-notes.txt
Last active March 12, 2019 09:53
Notes: Docker 1st steps
https://docs.docker.com/get-started/part2/#publish-the-image
https://hub.docker.com/r/alexcheng/magento/~/dockerfile/
https://github.com/alexcheng1982/dockerfiles/blob/master/apache-php7/Dockerfile
--------------
preparing windows 10 host drives to use with docker containers easily.
My directory structure:
# win10 host
@ljay79
ljay79 / filebeat.yml
Last active June 14, 2017 11:15
filebeat.yml config for apache log shipping to logz.io
############################# Filebeat #####################################
filebeat:
prospectors:
-
paths:
- /var/log/httpd/access_log
fields:
logzio_codec: plain
token: LOGZIO-TOKEN
fields_under_root: true
@ljay79
ljay79 / lbcheck.php
Last active August 22, 2016 14:07 — forked from jrodriguez-ifuelinteractive/lbcheck.php
Magento load balancer health check script
<?php
include './app/Mage.php';
try {
Mage::app();
// echo gethostname();
echo $_SERVER["SERVER_ADDR"]; // local IP, for instances behind ELB
} Catch (Exception $e) {
header("HTTP/1.0 503 Service Unavailable");
}