Skip to content

Instantly share code, notes, and snippets.

View stormwild's full-sized avatar
🏠
Working from home

Alexander R Torrijos stormwild

🏠
Working from home
View GitHub Profile
@stormwild
stormwild / functions-mu-encryption.php
Created January 15, 2020 08:15 — forked from muhammad-naderi/functions-mu-encryption.php
Wordpress encrypt usermeta data database
<?php
/**
* Created by PhpStorm.
* User: Muhammad
* Date: 05/07/2016
* Time: 01:20 PM
*/
add_filter('get_user_metadata', 'decrypt_user_meta',10,4);

NGINX 1.10 + APACHE 2.4 real IP for reverse proxy

Edit nginx conf

default.conf or what you want

vim /etc/nginx/conf.d/default.conf

add proxy_set_header for php files

@stormwild
stormwild / gist:e6f44b6cf09df23a8080fe58d0491017
Created May 31, 2019 16:22 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@stormwild
stormwild / SQL Cheat Sheet.md
Created May 12, 2019 10:06 — forked from janikvonrotz/SQL Cheat Sheet.md
SQL Cheat Sheet#SQL#Markdown

SQL languages

DDL is short name of Data Definition Language, which deals with database schemas and descriptions, of how the data should reside in the database.

DML is short name of Data Manipulation Language which deals with data manipulation, and includes most common SQL statements such SELECT, INSERT, UPDATE, DELETE etc, and it is used to store, modify, retrieve, delete and update data in database.

DCL is short name of Data Control Language which includes commands such as GRANT, and mostly concerned with rights, permissions and other controls of the database system.

Datatypes

Text types

@stormwild
stormwild / UploadController.cs
Created January 31, 2019 12:56 — forked from eouw0o83hf/UploadController.cs
File upload with React component and dotnet core web API controller
using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace Demo.Web.Controllers
{
public class UploadController : Controller
{
@stormwild
stormwild / docker-cleanup-resources.md
Created January 2, 2019 08:46 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@stormwild
stormwild / ffmpeg.md
Created December 22, 2018 08:36 — forked from neilrenicker/ffmpeg.md
How to convert an m4a file to an mp3 using ffmpeg

Convert an m4a file to an mp3 using ffmpeg

  • Install ffmpeg using homebrew:
brew install ffmpeg
  • convert the file:
@stormwild
stormwild / generate-public-key-from-private-key.md
Last active November 11, 2018 11:18 — forked from zircote/ssh.sh
Convert a AWS PEM into a ssh pub key
<?php
namespace App\Http;
/**
* Description of VideoStream
*
* @author Rana
* @link https://gist.github.com/vluzrmos/d5682ad426525196d069
*/
@stormwild
stormwild / mysql-docker.sh
Last active August 14, 2018 14:36 — forked from spalladino/mysql-docker.sh
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
docker exec -it <containerIdOrName> bash
## References