Skip to content

Instantly share code, notes, and snippets.

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

Lix Oranzh

🏠
Working from home
  • Xi'an China
  • 21:25 (UTC -12:00)
View GitHub Profile
@Oranzh
Oranzh / dnsmasq OS X.md
Created January 27, 2022 14:17 — forked from ogrrd/dnsmasq OS X.md
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

@Oranzh
Oranzh / 1README.md
Created June 9, 2021 01:21 — forked from joseluisq/1README.md
Configure PHP Lumen 5 HTTP Exception Handlers with common JSON responses.

Lumen 5 HTTP Exception Handlers with JSON support.

Configure PHP Lumen 5 HTTP Exception Handlers with common JSON responses.

image

Setup

Copy (replace) only the attached files to their respective directories. app/Exceptions/Handler.php and app/Http/Middleware/Authenticate.php

@Oranzh
Oranzh / Install-Mcrypt.md
Created April 6, 2021 13:28 — forked from idleberg/Install-Mcrypt.md
Install Mcrypt on macOS

Setup php-mcrypt on macOS (and versions of Mac OS X)

These steps should have been mentioned in the prerequisites of the Laravel Installation Guide, since I'm surely not the only person trying to get Laravel running on macOS.

Install

Install Mcrypt using Homebrew and PECL (comes with PHP)

# PHP 7.3
@Oranzh
Oranzh / curl.md
Created January 21, 2019 03:36 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@Oranzh
Oranzh / mysql_helpful_commands.md
Created January 10, 2019 02:43 — forked from joseluisq/mysql_helpful_commands.md
Some useful commands and scripts for MySQL.

MySQL helpful commands and scripts

Some useful commands and scripts for MySQL.

Import script file from console

mysql -h host -u username -p password --default_character_set utf8 database_name < mysql_script.sql

Or on MySQL shell type:

@Oranzh
Oranzh / openssl.ssh
Created April 26, 2018 03:15 — forked from mbejda/openssl.ssh
Installing OpenSSL 1.0.2 on Ubuntu 14
openssl version -a
sudo add-apt-repository ppa:0k53d-karl-f830m/openssl
sudo apt-get update
sudo apt-get install openssl
openssl version -a
@Oranzh
Oranzh / AES-256 encryption and decryption in PHP and C#.md
Created March 24, 2018 04:19
AES-256 encryption and decryption in PHP and C#

AES-256 encryption and decryption in PHP and C#

Update: There is a more secure version available. Details

PHP

<?php

$plaintext = 'My secret message 1234';