Referrence pallets/click#737
import functools
import pytest
# One liner for counting unique IP addresses from nginx logs | |
# Feel free to comment with better ideas - I'm sure it's not the best way of doing this (I'm no awk ninja!) | |
# | |
# Sample output: | |
# | |
# $ cat example.com.access.log | awk -F " " '{a[$1]++ } END { for (b in a) { print b, "\t", a[b] } }' | |
# 66.65.145.220 49 | |
# 92.63.28.68 126 | |
cat example.com.access.log | awk -F " " '{a[$1]++ } END { for (b in a) { print b, "\t", a[b] } }' |
Referrence pallets/click#737
import functools
import pytest
ConfigMap Recursive directory issues. https://stackoverflow.com/questions/48937323/automatic-subdirectories-in-kubernetes-configmaps
Using a Helm template
tree -L 2 helm_templates/your-template
helm_templates/your-template
├── Chart.yaml
├── templates
│ ├── NOTES.txt
Just a quickie test in Python 3 (using Requests) to see if Google Cloud Vision can be used to effectively OCR a scanned data table and preserve its structure, in the way that products such as ABBYY FineReader can OCR an image and provide Excel-ready output.
The short answer: No. While Cloud Vision provides bounding polygon coordinates in its output, it doesn't provide it at the word or region level, which would be needed to then calculate the data delimiters.
On the other hand, the OCR quality is pretty good, if you just need to identify text anywhere in an image, without regards to its physical coordinates. I've included two examples:
####### 1. A low-resolution photo of road signs
package helpers | |
import ( | |
"os/exec" | |
"strconv" | |
) | |
sub func02 { | |
my ( $a, $b ) = @_; | |
if ( $a eq 'g' ) { | |
if ( $b eq 'c' ) { | |
print "win"; | |
} elsif ( $b eq 'p' ) { | |
print "lose"; | |
} else { | |
print "draw"; |
Laravel mysql docker composer template
#!/usr/bin/env bash | |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
php -r "if (hash_file('sha384', 'composer-setup.php') === '93b54496392c062774670ac18b134c3b3a95e5a5e5c8f1a9f115f203b75bf9a129d5daa8ba6a13e2cc8a1da0806388a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" | |
php composer-setup.php | |
php -r "unlink('composer-setup.php');" | |
mv composer.phar /usr/local/bin/composer | |
echo "Composer installation finished." |
// replace your-folder below with the folder for which you want a listing | |
function listFolderContents() { | |
var id = 'xxxxx'; | |
var folders = DriveApp.getFolderById(id).getFolders() | |
Logger.log(folders); | |
while (folders.hasNext()) { | |
var folder = folders.next(); | |
Logger.log(folder.getName()); | |
var contents = folder.getFiles(); |