Cheat Sheet

Sunday, May 20, 2018

Simplest column lat and column lon to geom type

0 comments
SELECT ST_SetSRID(ST_Point(lon, lat),4326) As wgs84long_lat FROM abc.def

Nanti explain..

Sunday, February 11, 2018

0 comments
Got error
Unhandled Exception: Npgsql.PostgresException: 54000: index row size 3656 exceeds maximum 2712 for index "index_details"

Solution on the internet showing to solve using custom indexing like MD5

But since my column type (indexed by `index_details) is jsonb, it won't be efficient. Hence, use GIN for indexing MD5.
CREATE INDEX index_details_gin ON table USING GIN (jsonb_column_name);

Note:
Careful when using 'Wizard' like to create column. You won't expect the kind of indexing they will auto assign to your column...

This is not specific language error (C#, VB, Py, Java..). This is more on design database.

Sunday, October 29, 2017

OpenNebula: Monitoring Information - ERROR="Mon Oct 30 11:32:54 2017 : Error monitoring Host opennebula-250 (0): sh: /var/tmp/one/im/kvm.d/../run_probes: No such file or directory

1 comments
[oneadmin@opennebula-250 ~]$ onehost list
  ID NAME            CLUSTER   RVM      ALLOCATED_CPU      ALLOCATED_MEM STAT
   0 opennebula-250  default     7  1400 / 3200 (43%)  38G / 62.4G (60%) err
[oneadmin@opennebula-250 ~]$ onehost show 0
HOST 0 INFORMATION
ID                    : 0
NAME                  : opennebula-250
CLUSTER               : default
STATE                 : ERROR
IM_MAD                : kvm
VM_MAD                : kvm
LAST MONITORING TIME  : 10/30 11:32:54

HOST SHARES
TOTAL MEM             : 62.4G
USED MEM (REAL)       : 12.4G
USED MEM (ALLOCATED)  : 38G
TOTAL CPU             : 3200
USED CPU (REAL)       : 0
USED CPU (ALLOCATED)  : 1400
RUNNING VMS           : 7

LOCAL SYSTEM DATASTORE #0 CAPACITY
TOTAL:                : 2.7T
USED:                 : 19.2G
FREE:                 : 2.7T

MONITORING INFORMATION
ARCH="x86_64"
CPUSPEED="2399"
ERROR="Mon Oct 30 11:32:54 2017 : Error monitoring Host opennebula-250 (0): sh: /var/tmp/one/im/kvm.d/../run_probes: No such file or directory
"
HOSTNAME="opennebula-250.localdomain"
HYPERVISOR="kvm"
IM_MAD="kvm"
MODELNAME="Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz"
NETRX="2631437455"
NETTX="129750876"
RESERVED_CPU=""
RESERVED_MEM=""
VERSION="5.2.1"
VM_MAD="kvm"

WILD VIRTUAL MACHINES

NAME                                                      IMPORT_ID  CPU     MEMORY

VIRTUAL MACHINES

    ID USER     GROUP    NAME            STAT UCPU    UMEM HOST             TIME
     3 oneadmin oneadmin JUMP Server     unkn  0.0      4G opennebula 109d 18h19
     4 oneadmin oneadmin Temp 4GB 4vcpu  unkn  0.0      8G opennebula 107d 20h20
     5 oneadmin oneadmin KDN MDC Databas unkn  0.0      8G opennebula 103d 00h37
     6 oneadmin oneadmin KDN MDC FrontEn unkn  0.0      2G opennebula 103d 00h37
     7 oneadmin oneadmin KDN MDC Databas unkn  0.0      8G opennebula 103d 00h36
     8 oneadmin oneadmin KDN MDC Backend unkn  0.0      4G opennebula 103d 00h35
     9 oneadmin oneadmin KDN MDC Backend unkn  0.0      4G opennebula 103d 00h35
[oneadmin@opennebula-250 ~]$ ping opennebula-250
PING opennebula-250 (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.064 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.019 ms

See?

Solution is actually pretty simple.

remove
/var/tmp/one
(as root) and run back
onehost sync --force
as oneadmin



+1 to https://stackoverflow.com/questions/36485710/opennebula-error-monitoring-host-kvm (not really a ruby problem)

Thursday, August 24, 2017

pertapaan

0 comments
Hasil menurun..

less access_log | awk '{print $1}' | sort | uniq -c  | sort -nk1,1

Kemudian,

ufw insert 1 deny from IPADDR comment 'ddos'

Tuesday, June 13, 2017

Short note on installing Ambari

0 comments

Prerequisite


Don't forget to install this first:


yum install rpm-build
yum install gcc-c++
yum install epel-release
yum install nodejs
npm install -g brunch

# install python 2.7 setuptools
wget https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg#md5=fe1f997bc722265116870bc7919059ea
sh setuptools-0.6c11-py2.7.egg


mvn ambari-metrics-storm-sink fetch package failure



Error:
Failed to execute goal on project ambari-metrics-storm-sink: Could not res:storm-core:jar:1.1.0-SNAPSHOT in apache-hadoop

Reason:
There's no storm-core:jar:1.1.0-SNAPSHOT in repo (ref: http://repo.hortonworks.com/content/groups/public/org/apache/storm/storm-core/1.1.0/)

Solution:
Change ./ambari-metrics-storm-sink/pom.xml


From

<properties>
<storm.version>1.1.0-SNAPSHOT</storm.version>
</properties>

To

<properties>
<storm.version>1.1.0</storm.version>
</properties>



psutils-compile failure



Reason:
Python development tools is needed. Just install python-devel on CentOS.


finally





he he he



Thursday, June 8, 2017

Dotnet restore fails: Microsoft.Composition 1.0.27 is not compatible with netcoreapp1.1

0 comments
Because:

Assembly Microsoft.Composition 1.0.27 was build wayy longer before netcoreapp comes into play. But all sources said that it was PCL-ed and should be working fine with netcoreapp or netstandard.

Solution:

Open up csproj, add this to <PropertyGroup> element:


<packagetargetfallback>
   $(PackageTargetFallback);portable-net45+win8+wp8+wpa81;
</packagetargetfallback>



And restore back packages using nu-package

Source: dotnet/corefx issues #9788