tail -n +11 /etc/passwd| sort -t$':' -k3 -n | awk -F":" \
'
BEGIN {
printf "GID | Name | User_dir | Bash_Access | Description \n"
printf "--- | ----------- | ----------------- | ------------------ | -----------------\n"
}
{
printf "%s | %s | %s | %s | %s\n",$3, $1, $6, $7, $5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Enable fractional scaling on Ubuntu 18.04 | |
# | |
# Problem: | |
# -------- | |
# - Ubuntu 18.04 runs on Gnome 3.28, whichs does not support fractional scaling (120%, 130%). | |
# - As a result, the text and icon on my 4K 27" monitor are very small. | |
# | |
# Usage: | |
# ------- |
I have a fast producer (client) and slow subscriber (server) due to slow Internet connection. How to decouple the connection such that server won't affect client performance?
- The server will not send any data back to client once the TCP connection is established. In my case, it is a data sink.
In order to avoid drag down client IO, e.g. waiting for ACK from server, there are a few solutions:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Thiss script would convert a pre-trained TF model to a servable version for TF Serving. | |
A pre-trained model can be downloaded here | |
https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo | |
Requirements: | |
* A directory contains pretrained model (can be download above). | |
* Edit three arguments `frozen_graph`, `model_name`, `base_dir` accordingly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Mortgage Calculator for fun | |
https://en.wikipedia.org/wiki/Mortgage_calculator | |
What I want to know: | |
---- What's interest that I have to pay at payment N ? | |
---- What's principal that I have to pay at payment N ? |
Reference: https://spark.apache.org/docs/latest/
- Install Java 8+, then add to
PATH
andJAVA_HOME
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""An example of how to use tf.Dataset in Keras Model""" | |
import tensorflow as tf # only work from tensorflow==1.9.0-rc1 and after | |
_EPOCHS = 5 | |
_NUM_CLASSES = 10 | |
_BATCH_SIZE = 128 | |
def training_pipeline(): | |
# ############# | |
# Load Dataset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "(lldb) Debug binary_tree", | |
"type": "cppdbg", |
OlderNewer