Skip to content

Instantly share code, notes, and snippets.

@viovanov
viovanov / bluemixpv.yaml
Last active March 10, 2020 07:31
bluemix persistent volume with storage class name
# needs the "containerization-nfs" namespace
# kubectl create -n containerization-nfs -f <URL>
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: nfs-provisioner-runner
rules:
- apiGroups: [""]
mkdir -p ~/.lucette/data
mkdir -p ~/.lucette/nfs
docker network create --subnet 192.168.240.0/24 cf
docker pull viovanov/lucette
docker run \
-it --rm --name lucette \
--net cf --ip 192.168.240.3 \
--env=DOMAIN=lucette.io \
--env=DEFAULT_APP_DISK_IN_MB=1024 \
--env=DEFAULT_APP_MEMORY=1024 \
1: all_classes.select {|c| Object.const_get("VCAP::CloudController").const_get(c.to_s) < Sequel::Model }
2: VCAP::CloudController::App
3: VCAP::CloudController::App.methods
4: VCAP::CloudController::App.associations
5: VCAP::CloudController::App.attr_internal
6: VCAP::CloudController::App.instance_variables
7: VCAP::CloudController::App.import_attributes
8: VCAP::CloudController::App.export_attrs
9: VCAP::CloudController::App.export_attributes
10: VCAP::CloudController::App.import_attrs
@viovanov
viovanov / run-web-server.bat
Created August 26, 2015 21:17
one liner to run a web server from a windows command prompt
powershell -command "$l = New-Object System.Net.HttpListener ; $l.Prefixes.Add('http://+:8080/'); $l.Start(); while ($l.IsListening) { $c = $l.GetContext() ; $q = $c.Request; Write-Output (date); $r = $c.Response ; $m = [System.Text.ASCIIEncoding]::ASCII.GetBytes(((gci -path env:*) | Out-String)); $r.ContentLength64 = $m.Length ; $r.OutputStream.Write($m, 0, $m.Length) ; $r.OutputStream.Dispose(); }"
@viovanov
viovanov / web-server-one-line.ps1
Created August 26, 2015 21:10
one liner for a powershell server
$l = New-Object System.Net.HttpListener ; $l.Prefixes.Add("http://+:8080/"); $l.Start(); while ($l.IsListening) { $c = $l.GetContext() ; $q = $c.Request; Write-Output (date); $r = $c.Response ; $m = [System.Text.ASCIIEncoding]::ASCII.GetBytes(((gci -path env:*) | Out-String)); $r.ContentLength64 = $m.Length ; $r.OutputStream.Write($m, 0, $m.Length) ; $r.OutputStream.Dispose(); }