Skip to content

Instantly share code, notes, and snippets.

View TNick's full-sized avatar

Nicu Tofan TNick

View GitHub Profile
{
"type": "DomainSetType",
"generalGrid": {
"type": "GeneralGridCoverageType",
"srsName": "http://www.opengis.net/def/crs/OGC/1.3//3844",
"axisLabels": [
"x",
"y"
],
"axis": [
@TNick
TNick / gist:acf8392ba4e9ba946707c94c140576df
Created November 29, 2020 09:25
pygeoapi-config.yaml
server:
bind:
host: 127.0.0.1
port: 5500
url: http://127.0.0.1:5500/oapi
mimetype: application/json; charset=UTF-8
encoding: utf-8
language: en-US
cors: true
@TNick
TNick / get-iptables.bat
Last active July 19, 2020 09:10
Retrive iptables output from remote server to an excel sheet in Windows using plink
@echo off
set plink=plink.exe
set putty_profile=PuttyProfile
set putty_user=yourself
set putty_port=22
echo === mangle ==============================================================
%plink% %putty_profile% -P %putty_port% -ssh -l %putty_user% -batch ^
-C "iptables --table mangle --list -n -v --line-numbers"
echo === nat =================================================================
@TNick
TNick / standalone-graphql.js
Last active March 7, 2020 06:42
react-admin standalone fake server for graphql
const express = require('express');
const cors = require('cors');
const generateData = require('data-generator-retail').default;
const jsonGraphqlExpress = require('json-graphql-server').default;
const log = require('debug')('fakeServer:alone-graphql:log');
log('-------------------------------------------------');
log('fakeServer is starting');
log('-------------------------------------------------');
@TNick
TNick / create-openwrt.sh
Created August 2, 2019 16:46
proxmox openwrt
#!/bin/bash
# Inspired by https://github.com/whiskerz007/proxmox_tuya-convert_container/blob/master/create_container.sh
# Arguments
#
# 1 - LXC_STORAGE (local-lvm by default)
# 2 - DISK_SIZE (1G by default) can be a number and must be followed
# by either a G or a M
# 3 - TEMPLATE (local:vztmpl/openwrt-18.06-openwrt_18.06.4_amd64.tar.gz by default)
# 4 - CORES (1 by default)
@TNick
TNick / confuzie.wkt
Last active June 3, 2016 16:00
Compar "Romania_double_stereo" si "Romania_double_stereo"
PROJCS["Romania_double_stereo",
GEOGCS["GCS_Pulkovo_1942",
DATUM["D_Pulkovo_1942",
SPHEROID["Krasovsky_1940",6378245.0,298.3]],
PRIMEM["Greenwich",0.0],
UNIT["Degree",0.0174532925199433]],
PROJECTION["Double_Stereographic"],
PARAMETER["Central_Meridian",25.0],
PARAMETER["Latitude_Of_Origin",46.0],
PARAMETER["Scale_Factor",0.99975],
@TNick
TNick / setup.bat
Created October 14, 2015 11:40
System-wide setup script for Windows machines; deals with Qt, MSVC, CMake
:: =========================================================
::
:: This script is intended to initialize the environment
:: with common variables usable across projects. It
:: calls vcvarsall.bat on your behalf.
::
:: The easiest way to use it is to define ENVSETUP
:: environment variable that points to it, then use
:: call %ENVSETUP% %~dp0
:: in your script.
@TNick
TNick / pylearn2-nosetests
Created June 27, 2015 18:07
Pylearn2 nosetests results
root@affe4bc530fd:/usr/local/src/pylearn2# nosetests
/usr/local/src/pylearn2/pylearn2/packaged_dependencies/theano_linear/test_matrixmul.py:62: UserWarning: TODO: port these disabled tests to the new pylearn2 setup
warnings.warn("TODO: port these disabled tests to the new pylearn2 setup")
/opt/conda/lib/python2.7/site-packages/matplotlib/__init__.py:1318: UserWarning: This call to matplotlib.use() has no effect
because the backend has already been chosen;
matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.
warnings.warn(_use_error_msg)
..................../usr/local/src/pylearn2/pylearn2/training_algorithms/bgd.py:141: UserWarning: BGD is not compatible with stochastic costs and cannot determine whether the current cost is stochastic.
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 22 columns, instead of 11. in line 2.
54,-0.8626198972520791,0.009085761037543617,2.2958860030635573,0.23291712283561183,0.13435410323793845,0.4262145840009325,0.11283843036941744,0.2725705693469231,-0.5384864000386496,1.4375791820246675,0.5111120646089605,0.5228546756712258,0.199208346448477,-0.7945393092112507,-1.5199302651824271,-1.5513605736166458,-1.4900106770167538,1.4375791820246675,-1.1665949159478515,-0.15932708395411033,-0.08508583445766538
51,-0.3152821953177781,0.024031943986622662,2.6742863361662805,0.31525195820084917,-0.11020464858852762,0.5895104816059669,0.11283843036941744,0.27523622267809505,-0.5384864000386496,1.4375791820246675,0.5111120646089605,0.49576074148738586,0.10330607681396907,-0.650077616627387,-1.5199302651824271,-1.5513605736166458,-1.4900106770167538,1.4375791820246675,-1.089658334238373,-0.14466261679023773,-0.012810359971564735
52,0.4847292450206044,0.09876285873201789,2.6742863361662805,0.23291712283561183,-1.2553790156118954,0.4240253313473069,0.5643585679378907,0.27123774268133705,-0.5384864000386496,1.43757
from pylearn2.utils import serial
from pylearn2.datasets.zca_dataset import ZCA_Dataset
dataset = ZCA_Dataset(
preprocessed_dataset=serial.load("${PYLEARN2_DATA_PATH}/cifar10/pylearn2_gcn_whitened/train.pkl"),
preprocessor=serial.load("${PYLEARN2_DATA_PATH}/cifar10/pylearn2_gcn_whitened/preprocessor.pkl"),
axes=['c', 0, 1, 'b']
)
from pylearn2.models.maxout import MaxoutConvC01B