TL;DR
Create a backup:
pg_dumpall > mybackup.sql
Perform the upgrade:
sudo pg_dropcluster 9.4 main --stop
/** | |
* setup JQuery's AJAX methods to setup CSRF token in the request before sending it off. | |
* http://stackoverflow.com/questions/5100539/django-csrf-check-failing-with-an-ajax-post-request | |
*/ | |
function getCookie(name) | |
{ | |
var cookieValue = null; | |
if (document.cookie && document.cookie != '') { | |
var cookies = document.cookie.split(';'); |
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
#!/bin/bash | |
sudo apt-get install xserver-xorg xserver-xorg-core x11-apps x11-xserver-utils |
# first, login with psql | |
psql -U USERNAME -d databasename | |
# set output for all queries | |
\o FILENAME.sql | |
# run this query | |
select 'drop table ' || tablename || ' cascade;' from pg_tables; | |
# logout from psql |
<a href="https://drive.google.com/uc?export=view&id=XXX"><img src="https://drive.google.com/uc?export=view&id=XXX" style="width: 500px; max-width: 100%; height: auto" title="Click for the larger version." /></a> |
Write-Host "Attempting to mount default registry hive" | |
& REG LOAD HKLM\DEFAULT C:\Users\Default\NTUSER.DAT | |
Push-Location 'HKLM:\DEFAULT\Software\Microsoft\Internet Explorer' | |
if (!(Test-Path Main)) { | |
Write-Warning "Adding missing default keys for IE" | |
New-Item Main | |
} | |
$sp = Get-ItemProperty -Path .\Main | |
Write-Host "Replacing $_ : $($sp.'Start Page')" |
TL;DR
Create a backup:
pg_dumpall > mybackup.sql
Perform the upgrade:
sudo pg_dropcluster 9.4 main --stop
Kris Nuttycombe asks:
I genuinely wish I understood the appeal of unityped languages better. Can someone who really knows both well-typed and unityped explain?
I think the terms well-typed and unityped are a bit of question-begging here (you might as well say good-typed versus bad-typed), so instead I will say statically-typed and dynamically-typed.
I'm going to approach this article using Scala to stand-in for static typing and Python for dynamic typing. I feel like I am credibly proficient both languages: I don't currently write a lot of Python, but I still have affection for the language, and have probably written hundreds of thousands of lines of Python code over the years.
"Proof connection at pyodbc level." | |
# Test pyodbc connection. Result is 42. | |
# Note parameters in connection string, <PARAMETER>. | |
import pyodbc | |
conn = pyodbc.connect('DRIVER=FreeTDS;SERVER=<IP_OR_HOSTNAME>;PORT=1433;DATABASE=<DATABASE_NAME>;UID=<USERNAME>;PWD=<PASSWORD>;TDS_Version=8.0;') | |
cursor = conn.cursor() | |
for row in cursor.execute('select 6 * 7 as [Result];'): |
from boto3.session import Session | |
from botocore.client import Config | |
from botocore.handlers import set_list_objects_encoding_type_url | |
import boto3 | |
ACCESS_KEY = "xx" | |
SECRET_KEY = "yy" | |
boto3.set_stream_logger('') |