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 / 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/"
@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
public Bitmap ConvertToSepia(Bitmap sampleBitmap){
float[] sepMat = {
0.3930000066757202f,
0.7689999938011169f,
0.1889999955892563f,
0,
0,
0.3490000069141388f,
0.6859999895095825f,
0.1679999977350235f,
@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 */
}
@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 / 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 / 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 / mysqldump.ps1
Last active October 11, 2018 16:28
Backup all databases in a mysql server
# Tool for mysql backup of all databases in an server.
# Author: Pedro Fernandes
# mysqldump.ps1
param([String]$s='localhost', [String]$u='root', [String]$p='P@ssw0rd', [String]$out='C:\Backups')
Write-Host "mysqldump.ps1 - Tool for mysql backup of all databases in an server."
Write-Host "Usage:"
Write-Host " -s: [localhost] Servername or IP address"
Write-Host " -u: [root] Username"
$app = Get-WmiObject -Class Win32_Product | Where-Object {
$_.Name -match "Microsoft .NET Core SDK"
}
Write-Host $app.Name
Write-Host $app.IdentifyingNumber
pushd $env:SYSTEMROOT\System32
$app.identifyingnumber |% { Start-Process msiexec -wait -ArgumentList "/x $_" }
@pmcfernandes
pmcfernandes / Start-Pomodoro.ps1
Created April 29, 2019 16:30 — forked from SQLvariant/Start-Pomodoro.ps1
A PowerShell function to create Pomodoro timer. Defaults to 25 minute timer.
<# PLEASE NOTE: I am not the original author of this function.
I found it online years ago, and have been using it ever since.
If you are the original author, please ping me and let me know,
so I can give you proper credit.
#>
Function Start-Pomodoro
{
Param (
[int]$Minutes = 25
)