# update system
sudo apt update && sudo apt upgrade -y
# install build tools and python prerequisites
sudo apt install build-essential libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev tk-dev libffi-dev
# download and extract python| [package] | |
| name = "vec" | |
| version = "0.1.0" | |
| authors = ["Frederik De Bleser <[email protected]>"] | |
| [lib] | |
| name = "vec" | |
| crate-type = ["dylib"] | |
| [dependencies] |
| ffmpeg -i https://s3-us-west-1.amazonaws.com/bucket/audio/file.wav \ | |
| -probesize 32 \ | |
| -analyzeduration 32 -c:a pcm_mulaw -ab 128k -ac 1 \ | |
| -ar 16000 -f wav -chunked_post 0 \ | |
| -content_type audio/axis-mulaw-128 \ | |
| http://root:[email protected]/axis-cgi/audio/transmit.cgi |
| # i3 move a workspace to another monitor (multi monitor setup) | |
| mode "move_workspace" { | |
| bindsym Up move workspace to output up | |
| bindsym Down move workspace to output down | |
| bindsym Left move workspace to output left | |
| bindsym Up move workspace to output up | |
| bindsym Escape mode "default" | |
| } |
| #!/bin/bash | |
| ## This gist contains step by step instructions to install cuda v9.0 and cudnn 7.2 in ubuntu 18.04 | |
| ### steps #### | |
| # verify the system has a cuda-capable gpu | |
| # download and install the nvidia cuda toolkit and cudnn | |
| # setup environmental variables | |
| # verify the installation | |
| ### |
| node{ | |
| docker.image('buildpack-deps:jessie-scm').inside { | |
| sh "echo 'hello' >> a.txt" | |
| stash includes: 'a.txt', name: 'pom' | |
| } | |
| docker.image('buildpack-deps:jessie-scm').inside { | |
| unstash 'pom' | |
| sh "cat a.txt" | |
| } |
This is pretty simple snippet to get API Token of a user , lets say "MYUser" in jenkins.
its pretty useful when you are working with 'jenkins-job-builder' to update jobs in jenkins,
and you need to get the api token which JJB needs inorder to update jobs to ..
run this code in either jenkins script console , or as i prefer, in form of init.groovy.
so when jenkins master starts, i create a user for JJb.
after that i get the token right away and pass it to my JJB jobs folder to file 'jenkins_jobs.ini' :)_ .
///////////////////////////////////////////////////////////////////////| import requests | |
| import json | |
| import cv2 | |
| addr = 'http://localhost:5000' | |
| test_url = addr + '/api/test' | |
| # prepare headers for http request | |
| content_type = 'image/jpeg' | |
| headers = {'content-type': content_type} |
| interface=tap_soft | |
| dhcp-range=tap_soft,192.168.30.50,192.168.30.250,24h | |
| dhcp-option=tap_soft,3,192.168.30.1 | |
| dhcp-option=tap_soft,option:dns-server,8.8.8.8,8.8.4.4 |
Moved to git repository: https://github.com/denji/nginx-tuning
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.