This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin [email protected] | |
ServerName www.example.com | |
ServerAlias example.com | |
ProxyRequests Off | |
<Proxy *> | |
Order deny,allow | |
Allow from all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#%PAM-1.0 | |
auth required pam_google_authenticator.so secret=${HOME}/.ssh/google_authenticator | |
auth required pam_sepermit.so | |
auth include password-auth | |
. . . | |
#/etc/pam.d/sshd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From Luke Quinane (http://stackoverflow.com/a/1197430/1028452) | |
// | |
// Usage: | |
// using (new NetworkConnection(@"\\server\read", readCredentials)) | |
// using (new NetworkConnection(@"\\server2\write", writeCredentials)) { | |
// File.Copy(@"\\server\read\file", @"\\server2\write\file"); | |
// } | |
public class NetworkConnection : IDisposable | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From Shiva (http://stackoverflow.com/a/487404/1028452) | |
static void Main(string[] args) | |
{ | |
using (FileStream fs = File.OpenRead(@"D:\temp\case\mytest.txt")) | |
{ | |
StringBuilder path = new StringBuilder(512); | |
GetFinalPathNameByHandle(fs.SafeFileHandle.DangerousGetHandle(), path, path.Capacity, 0); | |
Console.WriteLine(path.ToString()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. . . | |
Messages { | |
Name = Standard | |
mailcommand = "/usr/local/bin/sendEmail-backup \"[BACKUP] %t %e of %n %l\" \"%r\"" | |
operatorcommand = "/usr/local/bin/sendEmail-backup \"[BACKUP] Intervention needed for %j\" \"%r\"" | |
mail = [email protected] = all, !skipped | |
operator = [email protected] = mount | |
console = all, !skipped, !saved | |
append = "/var/log/bacula/bacula.log" = all, !skipped | |
catalog = all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT TABLE_SCHEMA, TABLE_NAME, ENGINE | |
FROM information_schema.TABLES | |
where ENGINE IS NOT NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create ifaces | |
iscsiadm -m iface -I iface0 -o new | |
iscsiadm -m iface -I iface0 | |
iscsiadm -m iface -o update -I iface0 -n iface.net_ifacename -v eth0 | |
# Discovery | |
iscsiadm -m discovery -t sendtargets -p 192.168.0.1 -I iface0 -I iface1 | |
# Delete undesired targets | |
iscsiadm -m node -T iqn.2014-01.com.example:vol0 -p 192.168.0.1 -o delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- CREATE USER AND GRANT PRIVILEGE | |
CREATE USER '[username]'@'localhost' IDENTIFIED BY '[password]'; | |
GRANT [type of permission] ON [database name].[table name] TO '[username]'@'localhost' [WITH GRANT OPTION]; | |
FLUSH PRIVILEGES; | |
-- PERMISSIONS LIST | |
-- ALL PRIVILEGES- allows a MySQL user all access to a designated database | |
-- CREATE- allows them to create new tables or databases | |
-- DROP- allows them to them to delete tables or databases | |
-- DELETE- allows them to delete rows from tables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. . . | |
UserParameter=net.if.discovery,ifconfig | awk ' BEGIN { print "{\"data\":\[" } /^[a-z0-9]+\:/ { gsub(/\:/,"",$ 1); if ( $ 1 != "lo0" ) print "{ \"{#IFNAME}\":\"" $ 1"\" }," } END { print "{ \"{#IFNAME}\":\"lo0\"} \n]}" } ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## /etc/sudoers.d/webacula | |
Defaults:apache !requiretty | |
apache ALL=(bacula) NOPASSWD: /usr/sbin/bconsole | |
## Bareos | |
# apache ALL=(bareos) NOPASSWD: /usr/sbin/bconsole | |
## Test using: | |
## `su -l apache -s /bin/sh \ |