Skip to content

Instantly share code, notes, and snippets.

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

Pedro Fernandes pmcfernandes

🏠
Working from home
View GitHub Profile
@pmcfernandes
pmcfernandes / install-php56.sh
Last active February 8, 2018 14:35
Install PHP 5.6 in Ubuntu Server
# Install repo
sudo add-apt-repository ppa:ondrej/php
# Install software-properties-common
sudo apt-get install software-properties-common
# Install php 5.6
sudo apt-get update
sudo apt-get install php5.6
sudo apt-get install php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml
@pmcfernandes
pmcfernandes / lamp.sh
Last active June 16, 2017 16:54
Configure Lamp and webmin in Ubuntu Linux
#!/bin/bash
su -i
# Create Swap space
fallocate -l 4G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile none swap sw 0 0' >> /etc/fstab
@pmcfernandes
pmcfernandes / Request.ts
Created May 1, 2017 17:19 — forked from azarus/Request.ts
SIMPLE AND EASY HTTP REQUESTS IN ANGULAR2! GET A PROMISE AND USE IT EASILY!
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import { Config } from '../Config';
import { Observable } from 'rxjs/Observable';
import 'rxjs/Rx';
@Injectable()
export class Request {
constructor(public http: Http)
@pmcfernandes
pmcfernandes / bootstrap3mediaqueries.css
Last active May 1, 2017 15:36
Media queries breakpoints for Boostrap 3.x
/* Smartphones (portrait and landscape) ----------- */
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen and (min-width : 321px) {
/* Styles */
}
public Bitmap ConvertToSepia(Bitmap sampleBitmap){
float[] sepMat = {
0.3930000066757202f,
0.7689999938011169f,
0.1889999955892563f,
0,
0,
0.3490000069141388f,
0.6859999895095825f,
0.1679999977350235f,
@pmcfernandes
pmcfernandes / iredmail.sh
Last active February 2, 2016 11:22
Install iRedMail
# Install iRedMail
sudo apt-get install postfix
wget https://bitbucket.org/zhb/iredmail/downloads/iRedMail-0.9.4.tar.bz2
tar xjf iRedMail-0.9.4.tar.bz2
cd iRedMail-0.9.4
bash iRedMail.sh
@pmcfernandes
pmcfernandes / sendmail.cf
Created January 23, 2015 22:00
Antispam Sendmail config
####
## The Anti-Spam and general blocking stuff
####
## The NDBM file used for the blocking rulesets
KSpam dbm -o /usr/local/mail/maps/AntiSpam
## Web page for info on the rulesets
D{WebPage}" - see http://www.bpfh.net/spam/"