All / Any

Geolocate IPv6 with Python

The Python library is supporting both IPv4 and IPv6 addresses. Users can get the library to process geolocation stuff.

Sample codes:

import IP2Location;

IP2LocObj = IP2Location.IP2Location();
IP2LocObj.open("data/IP-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WEATHER-MOBILE-ELEVATION-USAGETYPE-SAMPLE.BIN");
rec = IP2LocObj.get_all("19.5.10.1");

print rec.country_short
print rec.country_long
print rec.region
print rec.city
print rec.isp
print rec.latitude
print rec.longitude
print rec.domain
print rec.zipcode

Perl Module for getting user's geolocation via IPv6

Just a reference for those who are looking for geocoding with IPv6 using perl module.
http://ip2location.com/developers/perl

use Geo::IP2Location;
$obj = Geo::IP2Location->open("IP-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WEATHER-MOBILE-ELEVATION-USAGETYPE-SAMPLE.BIN");

my $countryshort = $obj->get_country_short("20.11.187.239");
my $countrylong = $obj->get_country_long("20.11.187.239");
my $region = $obj->get_region("20.11.187.239");
my $city = $obj->get_city("20.11.187.239");
my $latitude = $obj->get_latitude("20.11.187.239");

Autoscaling using the default EC2 plugin

Question: 

The EC2 autoscaling plugin doesn't seem to be working. When I try to set it up, it creates new VMs properly but doesn't add them to the security group(s) I set up.

Answer: 

We realized the API call for ec2 changed recently but were unable to include the fix in our latest release. We released a patch to make the correct API call (Included as part of http://get.stackato.com/kato-patch/3.4.1/batch-patch-05082014/) but that change required us to also change the name of the value we collect from /s/etc/autoscaling/autoscaling.yml. As we cannot patch config files (We'd either potentially overwrite changes made or potentially have a patch fail due to those changes), a manual step is required to get this working.

That step is as follows: In /s/etc/autoscaling/autoscaling.yml, Under platform_config, in the EC2 section, the key reading 'security_group: ' should read 'security_group_ids: '

snit methods with same name confuses tclchecker

It appears that tclchecker gets confused if the same method name is used in multiple types. For instance, with this code:

package require snit

snit::type Foo {
    method same_name { foo_arg } {
        set bar_arg $foo_arg
    }
}

snit::type Bar {
    method same_name { bar_arg } {
        set foo_arg $bar_arg
    }
}

It complains:

foo.tcl:5 (warnArgWrite) Overwriting procedure argument "bar_arg"
set bar_arg $foo_arg
^
foo.tcl:11 (warnArgWrite) Overwriting procedure argument "foo_arg"
set foo_arg $bar_arg
^

Why there's no ReadPrinter function in win32print?

Hello,

I am work on send data to printer and read status from printer using win32print module.

There's a function called WritePrinter in win32print module to a printer. But why there's no ReadPrinter function in win32print, which exists in windows api.

How could I get the feedback(two-way communication message) from printer?

Thank you very much

CPU Soft Locking Patch

Question: 

How do I fix CPU soft locking issues?

Answer: 

We have issued a patch which addresses CPU soft-locking errors and is labelled cpu-soft-locking in kato patch. It is not revertable. This patch upgrades the Ubuntu kernel from 3.8.0-30 to 3.13.0-32.

This patch requires a full reboot (ie: sudo reboot). You should back up your systems before applying the patch and plan for this downtime accordingly.

http://docs.stackato.com/3.2/admin/best-practices/index.html#bestpractic...

We recommend rebooting the core node first, followed by other routers/controllers, then any services nodes, followed by DEAs.

To minimize user application downtime, run 'kato node retire' on each DEA node before rebooting it. Repeat the process one node at a time to ensure app instances are gracefully redistributed to live DEA nodes before each reboot.

If you encounter any issues or have any questions, please contact ActiveState Support: stackato-support@activestate.com

Replace key pair value from one to other file

Hi Team,
Am quite new to programming need some pointers
I need a help regarding below requirement
where we have two files one with all config key pair values (file1.txt)
Second file is like template where these config keys are used

file1.txt
---------------
cofig1=hello
config2=world
cofig3=welcome
config4=great

file2.txt
-----------
message config1,
config3 to perl config2
perl config2 is config4

output.txt
--------------
message hello,
welcome to perl world
perl world is great

please let me any suggestions.
Thanks in advance

Kato patch external hosts

Question: 

I need to manually whitelist hosts in my corporate proxy. What hosts does kato patch need to access?

Answer: 

The hosts that kato patch needs to access may vary with local configuration, and may change depending on changes to 3rd party services such as rubygems.org.

We recently audited kato-patch and found it accesses the following hosts:

http://archive.ubuntu.com
http://get.docker.io
http://mirrors.kernel.org
http://security.ubuntu.com
https://a248.e.akamai.net
https://bb-m.rubygems.org
https://bundler.rubygems.org
https://get.stackato.com
https://github.com
https://registry.npmjs.org
https://rubygems.org
https://s3.amazonaws.com

ETA for ActivePerl 5.20.0

What is the timeline for Perl 5.20 via ActiveState?

Sorting of a list having lists as elements

I need to sort a list, having lists as elements.
e.g.
set list1 [list {s a c} {1 d 4} {0 s 9} {0 d s}]

the output should be like :

{0 9 s} {0 d s} {1 4 d} {a c s}