Skip to content

Instantly share code, notes, and snippets.

View micheledurante's full-sized avatar
🚌
beep beep

micheled micheledurante

🚌
beep beep
View GitHub Profile
@micheledurante
micheledurante / CustomGlobal.cs
Created July 24, 2017 10:18 — forked from csharpforevermore/CustomGlobal.cs
Custom Global.asax.cs for Umbraco 7
public class CustomGlobal : UmbracoApplication
{
public void Init(HttpApplication application)
{
application.PreRequestHandlerExecute += application_PreRequestHandlerExecute;
application.BeginRequest += this.Application_BeginRequest;
application.EndRequest += this.Application_EndRequest;
application.Error += Application_Error;
}
@micheledurante
micheledurante / apache.md
Last active September 23, 2017 12:57
apache stuff

Switch PHP module


Apache:
sudo a2dismod phpx.x
sudo a2enmod phpX.X
sudo service apache2 restart

CLI:
update-alternatives --set php /usr/bin/phpX.X
  • New user CREATE USER 'testuser'@'localhost' IDENTIFIED BY 'test123test!';

  • Remove user DROP USER 'phpmyadmin'@'localhost';

  • Grant rights GRANT ALL PRIVILEGES ON mydb.* TO 'myuser'@'%' WITH GRANT OPTION;

  • Revoke rights REVOKE ALL PRIVILEGES ON phpmyadmin.* FROM 'phpmyadmin'@'localhost';

  • Import from backup SOURCE backup_file.sql;

@micheledurante
micheledurante / update_iptable_and_ip6tables_rules.md
Last active May 6, 2017 14:07
Update iptable and ip6tables rules

Show rules with line numbers sudo iptables -L --line-numbers

Insert rule at line Z sudo iptables -I INPUT Z -p tcp --dport 22 -j ACCEPT

Delete rule at line Z sudo iptables -D INPUT Z

Save changes sudo dpkg-reconfigure iptables-persistent

@micheledurante
micheledurante / keybase.md
Last active June 6, 2017 21:11
Keybase public key

Keybase proof

I hereby claim:

  • I am micheledurante on github.
  • I am micheled (https://keybase.io/micheled) on keybase.
  • I have a public key whose fingerprint is 37C0 665B B30F A589 B93A 116F FFAC 2D44 DD43 AC90

To claim this, I am signing this object:

@micheledurante
micheledurante / gist:a82353de618814ae363679ccb5494589
Created February 26, 2017 22:18
Default apache2 <Directory> setup for local dev
```
<Directory /home/micheled/git/scarabeus/public>
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
AllowOverride All
Order deny,allow
deny from all
allow from localhost
</Directory>
```