106 karma · joined Jul 27, 2015 (11y ago) · 26 submissions
comment 5y ago · link · parent
> Also looks powerful in it's own right
If you aren't convinced of that yet, I'd simply suggest to take a look at this lightning demo (~5 mins): https://www.youtube.com/watch?v=N1CBDTgGtOU
comment 5y ago · link · parent
That over there blew my mind, and I had to go back to the page to double-check that. And indeed, it's all clever CSS trickery. Digging further into the source, I found that this was generated using the ansi2html [1] library which I had never heard about before. Thanks for the TIL!
comment 6y ago · link · parent
Case in point: I had a directory containing thousands of .jpg images imported from a foreign filesystem, and all of those files had tildes in them, something like:
$ ls -1
EL+�CTRICO_0001.jpg
EL+�CTRICO_0002.jpg
EL+�CTRICO_0003.jpg
...
You get the idea; note those ugly unrepresentable characters over there. On the original filesystem they read as "ELÉCTRICO", but that tilde was saved using who knows what encoding, and I simply wanted to get rid of them and have nice ascii "ELECTRICO_xxxx.jpg" files. After finding out that the strange unrepresentable character was the byte 0xEB (so, in order to form an "É" you needed those two characters together: a literal '+' and 0xEB), I could do the bulk renaming with just: $ perl-rename 's/\+\xeb/E/' *.jpg
Felt so good!comment 8y ago · link · parent
8.
Google Cloud Memorystore for Redis(cloud.google.com ↗)
6 points · by asamarin · 8y ago · discuss
comment 8y ago · link · parent
- Function that actually parses /etc/hosts is name_from_hosts(), implemented here: http://git.musl-libc.org/cgit/musl/tree/src/network/lookup_n...
- Which is called by __lookup_name() on the same file: http://git.musl-libc.org/cgit/musl/tree/src/network/lookup_n...
- Which is, in turn, called directly from getaddrinfo() [http://git.musl-libc.org/cgit/musl/tree/src/network/getaddri...], the actual function exposed to you as libc user.
comment 8y ago · link · parent
[1] https://cloudplatform.googleblog.com/2017/09/Java-8-on-App-E...
comment 8y ago · link · parent
comment 8y ago · link · parent
- Java 8 is already generally available on GAE standard and, on top of that, previous limitations wr/t class whitelisting, threading capabilities and others have been lifted
- appcfg is pretty much outdated these days; all GAE management operations have been progressively integrated into gcloud app subcommand, which also fully supports newer GAE features like Flex, firewall rules, etc.
- GAE standard instances are indeed limited in computing power, but it should be enough for most web-based applications. Again, GAE Flex fills in the gap here in case more muscle is needed, since it leverages GCE-class instances
- Besides the already mentioned background work options (background threads, task queues, cron jobs), there's also Pub/Sub which can be used to inter-communicate GAE services or even other GCP services like GCE or GKE
comment 9y ago · link · parent
jq & jo are the Calvin & Hobbes of the shell: lots of fun together!
A few examples:
- Generate a simple JSON object:
$ jo foo=12 bar=true baz=null
{"foo":12,"bar":true,"baz":"null"}
- Want a nested object? $ jo foo=12 bar=true baz=null thing=$(jo number=57 test=string)
{"foo":12,"bar":true,"baz":"null","thing":{"number":57,"test":"string"}}
- What about arrays? $ jo thing=$(jo number=57 test=string) anarray=$(jo -a 1 2 3 4 5)
{"thing":{"number":57,"test":"string"},"anarray":[1,2,3,4,5]}
- Now let's add some jq magic to sum all the values in the array together: $ jo thing=$(jo number=57 test=string) anarray=$(jo -a 1 2 3 4 5) | jq '.anarray | add'
15
Great stuff :)comment 10y ago · link · parent
With regards to JSON, not sure what you mean, since getting e.g. instance zone from metadata server gives you a plain text string like "projects/<PROJECT_NUMBER>/zones/europe-west1-d". AFAIK, the only way to get JSON-like results is by making recursive requests, such as:
$ curl -H 'Metadata-Flavor: Google' "http://metadata/computeMetadata/v1/instance/?recursive=true"
And even in that case, you can choose plain text format by appending "alt=text" as query string parameter: $ curl -H 'Metadata-Flavor: Google' "http://metadata/computeMetadata/v1/instance/?recursive=true&alt=text"comment 10y ago · link · parent
- Null Program: http://nullprogram.com/index/
- Insane Coding: http://insanecoding.blogspot.com
- Agner Fog's Blog: http://www.agner.org/optimize/blog
comment 10y ago · link · parent
25.
Mapping Your Knowledge to Google Cloud Platform(googlecloudplatform.blogspot.com ↗)
2 points · by asamarin · 10y ago · discuss
comment 11y ago · link · parent