Skip to content

Instantly share code, notes, and snippets.

View alvin4frnds's full-sized avatar
🎯
Focusing

Praveen Kumar alvin4frnds

🎯
Focusing
View GitHub Profile
#!/bin/bash
for cmd in "$@"; do {
echo "Process \"$cmd\" started";
$cmd & pid=$!
PID_LIST+=" $pid";
} done
trap "kill $PID_LIST" SIGINT
const shajs = require('sha.js');
const mcrypt = require('mcrypt');
const CryptoJS = require("crypto-js");
const crypto = require('crypto');
class MCrypt {
static get key() {
//noinspection JSUnresolvedFunction
return shajs('sha256')
<?php
/**
* Created by PhpStorm.
* User: praveen
* Date: 02/09/17
* Time: 1:32 PM
*/
namespace App\Medi;
package com.medimetry.appmedi.utility;
import android.util.Base64;
import java.security.MessageDigest;
import java.security.spec.AlgorithmParameterSpec;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
find . -type f -name "*.php" -exec rm -f {} \;
@alvin4frnds
alvin4frnds / MAC OS X: mapping 127.0.0.1:3000 to mydomain.com locally on my machine
Created October 22, 2018 12:36
I was able to get this working using the ifconfig and pfctl commands on Mac 10.10.2. With the following approach I'm successfully mapping 127.0.0.1:3000 to mydomain.com locally on my machine.
In your command line enter the following two commands to forward connections to 127.0.0.1:3000 to 10.0.0.1:
sudo ifconfig lo0 10.0.0.1 alias
echo "rdr pass on lo0 inet proto tcp from any to 10.0.0.1 port 80 -> 127.0.0.1 port 3000" | sudo pfctl -ef -
Then edit your /etc/hosts or /private/etc/hosts file and add the following line to map your domain to 10.0.0.1.
10.0.0.1 mydomain.com
After you save your hosts file flush your local DNS:
sudo discoveryutil udnsflushcaches
@alvin4frnds
alvin4frnds / MAC OS X: mapping 127.0.0.1:3000 to mydomain.com locally on my machine
Created October 22, 2018 12:35
I was able to get this working using the ifconfig and pfctl commands on Mac 10.10.2. With the following approach I'm successfully mapping 127.0.0.1:3000 to mydomain.com locally on my machine.
In your command line enter the following two commands to forward connections to 127.0.0.1:3000 to 10.0.0.1:
sudo ifconfig lo0 10.0.0.1 alias
echo "rdr pass on lo0 inet proto tcp from any to 10.0.0.1 port 80 -> 127.0.0.1 port 3000" | sudo pfctl -ef -
Then edit your /etc/hosts or /private/etc/hosts file and add the following line to map your domain to 10.0.0.1.
10.0.0.1 mydomain.com
After you save your hosts file flush your local DNS:
---
- name: Print to stdout
hosts: all
tasks:
- command: echo "hello {{ yourName }}, i am {{ myName }}"
register: hello
- debug: msg="{{ hello.stdout }}"
---
- name: Print to stdout
hosts: all
tasks:
- command: echo "hello {{ myName }}"
register: hello
- debug: msg="{{ hello.stdout }}"
<?php
/**
* Trait for handling serialized columns for laravel projects
*/
namespace App\Traits;
trait HaveSerializedColumns
{