Skip to content

Instantly share code, notes, and snippets.

@ferodss
ferodss / gist:5762620
Last active April 10, 2016 17:29
Compile Apache 2.4.4 with SSL, FastCGI and PHP 5.4 as FPM on CentOS for Magento store
### ADD RPM Forge repository
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm # Verifies the package
rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm
### APACHE
# Dependencies
@JustinSencion
JustinSencion / usefull_comands.md
Last active May 22, 2017 22:29
Usefull commands

CentOS 7 Fails to Boot - XFS Corrupt - Enters Emergency Mode

bash xfs_repair -L /dev/mapper/centos-root

Networking Issues

Stop NetworkManager.

bash service NetworkManager stop

@bitkidd
bitkidd / deleting_tons_of_files_in_linux.md
Last active August 14, 2018 13:59
Deleting tons of files in Linux (Argument list too long)

If you’re trying to delete a very large number of files at one time (I deleted a directory with 485,000+ today), you will probably run into this error:

/bin/rm: Argument list too long.

The problem is that when you type something like “rm -rf ”, the “” is replaced with a list of every matching file, like “rm -rf file1 file2 file3 file4” and so on. There is a reletively small buffer of memory allocated to storing this list of arguments and if it is filled up, the shell will not execute the program. To get around this problem, a lot of people will use the find command to find every file and pass them one-by-one to the “rm” command like this:

find . -type f -exec rm -v {} \;

My problem is that I needed to delete 500,000 files and it was taking way too long.

@bdunlap
bdunlap / resend-order-webhook.php
Created May 11, 2012 13:56
Resends a Shopify order to a webhook target
<?php
define('API_KEY', 'YOUR API KEY HERE');
define('SECRET', 'YOUR SECRET HERE');
define('STORE_DOMAIN', 'YOUR STORE DOMAIN HERE');
define('WEBHOOK_TARGET', 'your webhook URL here');
ini_set('display_errors', 'On');
ini_set('html_errors', 'Off');
error_reporting(-1);
@snipe
snipe / dqh+aws
Last active September 11, 2019 15:06
DeployHQ+AWS Autoscalers
#!/bin/bash
# Set these variables
USER_NAME="you@example.com"
API_KEY="XXXXXXXX_YOUR_DHQ_API_KEY_XXXXXXXXXXXXX"
START_REV='SOME_ARBITRARY_GIT_REVISION_HASH_TO_START_FROM'
DHQ_API_PROJ="your-project-shortname"
DHQ_BASE_URL="https://yoursite.deployhq.com/"
DHQ_SERVER_GROUP="YOUR_SERVER_GROUP_UUID"
DHQ_SERVER_USERNAME="your-server-username"
@francois-blanchard
francois-blanchard / debug_travis_build.md
Last active September 15, 2020 08:55
How to debug a failed travis.ci build

How to debug a failed travis.ci build

1/ Go to travais build

https://travis-ci.com/gitUser/gitRepo/builds/XXXXXX

build

2/ Connect to travis build with ssh

@peatiscoding
peatiscoding / build-tag-push.py
Created January 24, 2018 15:20
a script to convert your docker-compose.yml (version 2) with build node to image node; this script required DOCKERHUB_USER environment available.
#!/usr/bin/python
import os
import subprocess
import time
import yaml
import re
user_name = os.environ.get("DOCKERHUB_USER")
@sergiotabanelli
sergiotabanelli / REVAMPED.md
Last active March 26, 2022 17:55
MYSQLND_MS REVAMPED: Single and multi-master read/write consistency enforcing in MySQL asynchronous clusters with PHP and mysqlnd_ms extension

MYSQLND_MS REVAMPED: Single and multi-master read/write consistency enforcing in MySQL asynchronous clusters with PHP and mysqlnd_ms extension

NOTE: The service level and consistency feature is one of the most changed areas of the mymysqlnd_ms fork. Functionalities like server side read consistency and server side write consistency allow transparent migration to MySQL asyncronous clusters in almost all use cases with no or at most extremely small effort and application changes.

Different types of MySQL cluster solutions offer different service and data consistency levels to their users. Any asynchronous MySQL replication cluster offers eventual consistency by default. A read executed on an asynchronous slave may return current, stale or no data at all, depending

@reinaldomendes
reinaldomendes / curl.ini
Last active March 28, 2022 06:41
PHP Curl error 77 on ssl conections
;###################################################
; NOTE
;####################################################
; change your curl.ini on /etc/php.d/curl.ini
;
;This config was only tested on amazon AMI
;Please check if /etc/ssl/certs/ca-bundle.crt exists
;
;If you don't have the ca-bundle root certificate you
; can get this in
@Dillie-O
Dillie-O / get_all_media.ps1
Created October 20, 2016 22:57
PowerShell script to iterate all containers and blobs in a storage account and download it.
$destination_path = 'C:\Users\dilli\Downloads\media_dump'
$connection_string = '[AZURE_STORAGE_CONNECTION_STRING]'
$storage_account = New-AzureStorageContext -ConnectionString $connection_string
$containers = Get-AzureStorageContainer -Context $storage_account
Write-Host 'Starting Storage Dump...'
foreach ($container in $containers)