Skip to content

Instantly share code, notes, and snippets.

## Make /www directory
## Edith apache.conf
<Directory />
#Options FollowSymLinks
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order deny,allow
Allow from all
</Directory>
#!/bin/sh
# This script imports untrusted self signed certificates to you browser
# usage: import-cert.sh remote.host.name [port]
#
REMHOST=$1
REMPORT=${2:-443}
exec 6>&1
exec > $REMHOST
echo | openssl s_client -connect ${REMHOST}:${REMPORT} 2>&1 |sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'
certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "$REMHOST" -i $REMHOST
[a-zA-Z0-9_]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?!([a-zA-Z0-9]*\.[a-zA-Z0-9]*\.[a-zA-Z0-9]*\.))(?:[A-Za-z0-9](?:[a-zA-Z0-9-]*[A-Za-z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?
@uchm4n
uchm4n / Curl_Multi.php
Last active May 13, 2017 19:46
Curl Multi Request
<?php
// Usage
// Get Request
// pool(['url1',''url2','url3'])
//
// Post Request
// $data[0]['url'] = 'endpoint1';
// $data[0]['post'] = [];
// $data[0]['post']['param1'] = ['paramValue1'];
#Searchin for particular words in linux
grep -rn "search_word" /tmp/
@uchm4n
uchm4n / composer_versions_cheatsheet.md
Created June 29, 2017 21:33 — forked from calebporzio/composer_versions_cheatsheet.md
Composer version symbol cheatsheet
...
"require": {
    "vendor/package": "1.3.2", // exactly 1.3.2 (exact)

    // >, <, >=, <= | specify upper / lower bounds
    "vendor/package": ">=1.3.2", // anything above or equal to 1.3.2
    "vendor/package": "<1.3.2", // anything below 1.3.2

 // * | wildcard
@uchm4n
uchm4n / MessageOfTheDay
Last active October 25, 2017 09:08
This is valid for Ubuntu servers
#! /usr/bin/env bash
# Basic info
IP=`hostname -I | awk '{print $1}'`
HOSTNAME=`uname -n`
#ROOT=`df -Ph | grep xvda1 | awk '{print $4}' | tr -d '\n'`
ROOT=`df -Ph | grep vda1 | awk 'NR==1{print $4}' | tr -d '\n'`
# System load
MEMORY1=`free -t -m | grep Total | awk '{print $3" MB";}'`
@uchm4n
uchm4n / reverse-ssh-tunnel
Created January 9, 2018 14:32
Setup Service on Ubuntu to make reverse ssh tunnel on remote server
# Ubuntu 15.04+
[Unit]
Description=Setup a secure tunnel to server
Wants=network-online.target
After=network-online.target
[Service]
User=admin
Environment="LOCAL_ADDR=localhost"
@uchm4n
uchm4n / bashrc.sh
Created August 8, 2018 11:27
Colorful prompt with git branch names
#colorful prompt with git branch names
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ '
-- Weigh rows against eachother based on different conditions,
-- ordering the results based on their given weights so that
-- more precise matches will show higher up in the results.
-- In this example, an exact match will show up at the top
-- of the results, a match at the beginning of the string
-- will show next, and a match anywhere will show last.
set @query = 'Liam';