Skip to content

Instantly share code, notes, and snippets.

View demiurg's full-sized avatar

Pavel demiurg

View GitHub Profile
Open RegEdit
Navigate to this Key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
Change “SecurityLayer” to a zero
Reboot and done!
.bashrc
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export PATH=/usr/local/bin:/usr/local/sbin:$PATH
export PATH="${PATH}:/usr/local/texlive/2014basic/bin/x86_64-darwin"
#export PATH="$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH"
@demiurg
demiurg / authorizekoba.sh
Last active November 29, 2018 16:50
authorizekoba.sh
set -e
ssh-keygen -f ~/.ssh/id_rsa -t rsa -N ""
echo 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDC5yHa4u65Vv3UORt0p6PXKQbUCzTNX+d+qBzJvnTUrFGOatIZP4XQ7lfh7qu2DI+IO98FPZoy05ZPKGYwSR9/aOdHxA1w+gwOeXMc4M/M9naGbNXAD/DkLxMY7vwG6cDDCHaF7iUQ4hlrynZ9o/riefpijlczFqjAEJgtGU63YgQm4bQPHkx2P0nTd6TFSWku6CfyfqWR0xotWcw5p5kaUgoTldxv1mixIJ3FKzlgSZu6RpdPcapWIcsbPlg9+OxBFYbTq5CtOaR7V522pREINmasckMIYvuF0av7U6A0UBhmFVVMmfxra/xkd2Xe3Iwo+w0+laQLCC5goyFB6RlL [email protected]' > ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
@demiurg
demiurg / filtering.js
Last active July 6, 2018 20:45
JavaScript FUN
filterSites = (sites, terms) => {
var REDUCERS = {
'AND': (acc, cur) => acc && cur,
'OR': (acc, cur) => acc || cur
};
var filtered_sites = Object.values(sites).filter((s) => {
if (s && typeof s == 'object'){
var props = s.properties;
var truths = terms.map((term, idx) => {
truncate -s +100G /data/containers/expand.img
sudo zpool set autoexpand=on lxd
# sudo zpool online -e lxd /data/containers/expand.img
sudo zpool add lxd /data/containers/expand.img
sudo zpool set autoexpand=off lxd
function handleMousemove(vmap){
var self = this;
self.event = null;
self.highlight = function(e){
console.log(self.event);
if (self.event != e){
return;
}

Keybase proof

I hereby claim:

  • I am demiurg on github.
  • I am demiurge (https://keybase.io/demiurge) on keybase.
  • I have a public key whose fingerprint is E936 0C2A FA92 1934 3F02 8E05 76D3 30F5 5D80 B570

To claim this, I am signing this object:

--- update fcpf_subnat_cea set geom_simple = st_simplify(st_buffer(st_buffer(st_simplify(wkb_geometry, 200), 200), -200), 2000) where hasc_1 = 'CL.MA';
--- update fcpf_subnat_cea set geom_simple = ST_MULTI(st_buffer(st_simplify(st_buffer(st_buffer(wkb_geometry, 500), -500), 2000), 0)) where not st_isvalid(geom_simple);
--- select hasc_1, uniquename, BIT_LENGTH(geom_simple::bytea)::int, st_isvalid(geom_simple) from fcpf_subnat_cea order by bit_length desc;
-- update fcpf_subnat_cea set geom_simple = ST_MULTI(st_buffer(st_simplify(st_buffer(st_buffer(st_simplify(wkb_geometry, 300), 500), -500), 2000), 0)) where hasc_1 = 'CL.AI' or hasc_1 = 'CL.MA';
-- select hasc_1 from fcpf_subnat_cea where not st_isvalid(geom_simple) or st_area(geom_simple) < 1;
#!/usr/bin/env python
import fiona
import csv
shp = fiona.open("TOWNSSURVEY_PT.shp")
print "Columns: {}".format(shp.schema['properties'].keys())
prop_csv = csv.DictWriter(open("props.csv", 'wb'), shp.schema['properties'].keys())
WITH empty AS(
SELECT ST_MakeEmptyRaster(256, 256, -5205055.878107, 7905423.213366, 9783.939620) as alignto
) SELECT ST_AsGDALRaster(
ST_Transform(ma3, alignto), 'PNG'
) as tiffvals,
FROM (
SELECT ST_MapAlgebra(
isUnion,
ma2,
'(CASE WHEN [rast1] <= 10 and [rast2] = 101 THEN 101 ELSE 100 END::int)'