Skip to content

Instantly share code, notes, and snippets.

@gorobey
gorobey / force-http.tpl
Created July 4, 2016 10:09 — forked from wodCZ/force-http.tpl
vestacp cert letsencrypt
server {
listen %ip%:%web_port%;
server_name %domain_idn% %alias_idn%;
location / {
rewrite ^(.*) https://%domain_idn%$1 permanent;
}
}
@gorobey
gorobey / lastpass_to_keepassx.rb
Created April 14, 2016 07:44 — forked from jmazzi/lastpass_to_keepassx.rb
Convert LastPass CSV to KeePassX XML
#!/usr/bin/ruby
#
# I recommend using Pocket to do the export. It works better than the browser extensions.
require 'rubygems'
require 'htmlentities'
require 'csv'
# CHANGE THIS
input_file = '/path/to/passwords.csv'
@gorobey
gorobey / gist:67a5d239ea069e15763e
Created March 7, 2016 10:49 — forked from joshhartman/gist:2271523
Yahoo! Weather API Example Using SimpleXML in PHP
<?php
if(isset($_POST['zipcode']) && is_numeric($_POST['zipcode'])){
$zipcode = $_POST['zipcode'];
}else{
$zipcode = '50644';
}
$result = file_get_contents('http://weather.yahooapis.com/forecastrss?p=' . $zipcode . '&u=f');
$xml = simplexml_load_string($result);
//echo htmlspecialchars($result, ENT_QUOTES, 'UTF-8');