Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
// Java : GetResourceAsStream In Static Method | |
// - http://www.mkyong.com/java/java-getresourceasstream-in-static-method/ | |
// If the method getFilePathToSave() is converted to static method, the getClass() | |
// method will be failed, and prompts "Cannot make a static reference to the non-static | |
// method getClass() from the type Object". | |
// Instead, you should use CurrentClass.class.getClassLoader().getResourceAsStream. | |
package com.mkyong.crawler.util; |
Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
/** | |
* Module dependencies | |
*/ | |
var express = require('express'); | |
var fs = require('fs'); | |
var mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
// img path |
# install needed libraries | |
sudo yum install texinfo libXpm-devel giflib-devel libtiff-devel libotf-devel | |
# compile autoconf | |
cd /tmp | |
wget ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.68.tar.bz2 | |
tar xjvf autoconf-2.68.tar.bz2 | |
cd autoconf-2.68/ | |
./configure && make && sudo make install |
# Dinh duong cho be | |
六个月宝宝辅食食谱 - http://baike.pcbaby.com.cn/qzbd/940050.html#ldjc4ta=baby_tbody5 | |
When a baby can eat yogurt? http://wholesomebabyfood.momtastic.com/tipyogurt.htm | |
Chế độ ăn dặm cho trẻ 6 tháng tuổi - http://tudu.com.vn/vn/suc-khoe-cua-be/che-do-an-dam-cho-tre-6-thang-tuoi/ | |
http://congai9.com/thoi-gian-bieu-cho-be-6-thang-an-dam/ |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the \
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon
with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
const http = require('http'); | |
const express = require('express'); | |
const redis = require('redis'); | |
const { RateLimiterRedis } = require('rate-limiter-flexible'); | |
const redisClient = redis.createClient({ | |
enable_offline_queue: false, | |
}); | |
const maxWrongAttemptsByIPperMinute = 5; | |
const maxWrongAttemptsByIPperDay = 100; |
check host localhost with address 127.0.0.1 | |
start "/sbin/start myapp" | |
stop "/sbin/stop myapp" | |
if failed port 3000 protocol HTTP | |
request / | |
with timeout 5 seconds | |
then restart |
Using our beloved docker and docker-compose, we can very quickly bring up an Apache Airflow instance on our mac.
About the only thing you need to customize in this docker-compose.yml file is the volumes section. This will tell docker to map the given directory containing your Airflow DAGs/plugins to container file system.
version: '3'
services: