Skip to content

Instantly share code, notes, and snippets.

mdadm

Glossary:

  • md: multiple devices
command description
cat /proc/mdstat show status of all raids
mdadm --detail /dev/md0 detailed status of raid md0
@emayk
emayk / Postfix Postscreen Options
Created May 21, 2018 00:43 — forked from stevejenkins/Postfix Postscreen Options
SteveJ's Postfix:Postscreen configuration options
# POSTSCREEN OPTIONS v2017-03-18
postscreen_access_list = permit_mynetworks,
cidr:/etc/postfix/postscreen_access.cidr,
cidr:/etc/postfix/postscreen_spf_whitelist.cidr,
hash:/etc/postfix/postscreen_whitelist
postscreen_blacklist_action = drop
postscreen_dnsbl_action = enforce
postscreen_greet_action = enforce
postscreen_dnsbl_threshold = 3
@emayk
emayk / Period_Converter_OptMOD.mq4
Created April 14, 2016 14:51 — forked from micclly/Period_Converter_OptMOD.mq4
Period_Converter_OptMOD.mq4 (build 6xx supported version)
//+------------------------------------------------------------------+
//| Period_Converter_Opt.mq4|
//| Copyright (c)2005, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//| Ver.1.6 Modified by micclly|
//| Ver.1.5 Modified by fai |
//| Modified by wfy05@talkforex based on Period_Converter|
//| http://www.talkforex.com |
//+------------------------------------------------------------------+
#property copyright "wfy05@talkforex.com"
@emayk
emayk / rsyncprogress.py
Created November 20, 2015 17:17 — forked from JohannesBuchner/rsyncprogress.py
Progress bar for rsync
"""
Progress bar for rsync
========================
Shows file progress and total progress as a progress bar.
Usage
---------
Run rsync with -P and pipe into this program. Example::
@emayk
emayk / laravel5_shared_hosting_project.sh
Last active August 29, 2015 14:28 — forked from meganlkm/laravel5_shared_hosting_project.sh
setup a laravel5 project to deploy to a shared hosting provider
#!/bin/bash
myproject='myproject'
mywww='public_html'
# initialize project
composer create-project laravel/laravel $myproject --prefer-dist
cd $myproject
# fix paths to public
sudo port install php55 +fastcgi fcgi apache-ant php55-cgi php55-mbstring php55-curl php55-mcrypt php55-imagick php55-xdebug php55-iconv php55-mongo php55-oauth php55-openssl php55-esmtp php55-pop3 php55-tidy php55-uploadprogress php55-pcntl php55-sockets php55-soap php55-ssh2 php55-big_int php55-gd php55-svm php55-html_parse php55-http php55-mysql php55-pdflib php55-pear php55-peb php55-posix php55-pspell php55-rar php55-redis php55-snmp php55-stomp php55-svn php55-wddx php55-xmlrpc php55-yaml php55-zip php55-dbase php55-excel php55-gdchart php55-imap php55-xsl php55-redis
sudo port install postgresql92 postgresql92-server postgresql92-doc postgresql_autodoc php55-postgresql phppgadmin postgresql-jdbc mysql5-server phpmyadmin maven3 maven-ant-tasks
sudo port install nginx +flv +geoip +gzip_static +mail +mp4 +ssl +status +substitution +upload +upload_progress +xslt +zip
You may need to update your php.ini for any changes that have been made in this version of php55. Compare /opt/local/etc/php55/php.ini wit
@emayk
emayk / crypt-example2.php
Created December 26, 2013 04:25
crypt exampl 2
<?php
//Listing 3: Encrypting Data Using the mcrypt_ecb Function
// source http://stackoverflow.com/questions/16600708/php-string-encrypt-and-decrypt
echo("<h3> Symmetric Encryption </h3>");
$key_value = "KEYVALUE";
$plain_text = "PLAINTEXT";
$encrypted_text = mcrypt_ecb(MCRYPT_DES, $key_value, $plain_text, MCRYPT_ENCRYPT);
echo ("<p><b> Text after encryption : </b>");
@emayk
emayk / crypt-example1.php
Created December 26, 2013 04:24
crypt example 1
<?php
define("ENCRYPTION_KEY", "!@#$%^&*");
$string = "This is the original data string!";
echo $encrypted = encrypt($string, ENCRYPTION_KEY);
echo "<br />";
echo $decrypted = decrypt($encrypted, ENCRYPTION_KEY);
/**
* Returns an encrypted & utf8-encoded
@emayk
emayk / gist:7140426
Created October 24, 2013 16:30
deploy laravel application to production server
#!/bin/bash
# inspiration [url]http://blog.rjmetrics.com/simple-deploy-script-for-php-applications/[/url]
# unzipping files [url]http://kb.winzip.com/kb/entry/124/[/url]
# todo: does current exist? does releases exist?
APP_NAME=clouddueling
DEPLOY_SERVER=
DEPLOY_PATH=/var/www/html
DEPLOY_USER=