How to implement email tracking solution?
The above code check if
nginX
has a module called empty_gif
that generates a 1*1 pixel image. It is usually put at the end of campaign emails in order to track how many users have opened the email. The code for nginX
is:location = /empty.gif {
empty_gif;
expires -1;
post_action @track;
}
location @track {
internal;
proxy_pass http://tracking-backend/track$is_args$args;
proxy_set_header x-ip $remote_addr;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
}
The above code check if
/empty.gif
URL is requested, if answer is yes then serve the image and makes expires
to -1
to not cache the image and finally using post_action
which calls a sub request after the current request has been fininshed. The parameters you need to pass is put after the image link in email like:https://www.example.com/empty.gif?token=SOMETHING_TO_TRACK#nginx #email #empty_gif #email_tracking #pixel
https://stackoverflow.blog/2018/09/05/developer-salaries-in-2018-updating-the-stack-overflow-salary-calculator/?cb=1
#salary #stackoverflow #report
#salary #stackoverflow #report
Stack Overflow Blog
Developer Salaries in 2018: Updating the Stack Overflow Salary Calculator
Today we launched the 2018 update to the Stack Overflow Salary Calculator, a tool that allows developers and employers to find typical salaries for the software industry based on experience level, location, education, and specific technologies.
How to convert the below line of string:
into:
As you may have noted you cannot use
#python #csv #reader #split #stringIO #byteIO
data = '15 0 42 50 "some text" "" 4 4 "text"'
into:
[15, 0, 42, 50, 'some text', '', 4, 4, 'text']
As you may have noted you cannot use
split
as there are texts with spaces in between. For that we can use the below code:import csv
import io
file = io.StringIO(data) # use io.BytesIO in python 2
reader = csv.reader(file, delimiter=' ')
split_data = next(reader)
parsed_data = [int(x) if x.isdigit() else x for x in split_data]
NOTE:
use io.BytesIO
instead of io.StringIO
in case you are using python 2.#python #csv #reader #split #stringIO #byteIO
How to disable visual block in
There is a feature in vim that as you select a text inside of vim, it turns the mode into
#vim #visual_block #mouse #set #vimrc
VIM
?There is a feature in vim that as you select a text inside of vim, it turns the mode into
VISUAL BLOCK
. This is annoying for me in case you want to disable it put the below code in ~/.vimrc
:set mouse-=a
#vim #visual_block #mouse #set #vimrc
https://www.bloomberg.com/news/features/2018-10-04/the-big-hack-how-china-used-a-tiny-chip-to-infiltrate-america-s-top-companies
#news #china #amazon #hack
#news #china #amazon #hack
Bloomberg.com
China Used a Tiny Chip in a Hack That Infiltrated U.S. Companies
The attack by Chinese spies reached almost 30 U.S. companies by compromising America's technology supply chain.
nethogs
is used to monitor network traffic. You can see which processes use the most bandwidth and hogs the network.Installtion on debian:
apt-get install nethogs
You can give the
nethogs
a network interface to see what's going on under the hood:nethogs eth0
The output would something like:
PID USER PROGRAM DEV SENT RECEIVED
9023 root python eth0 6.083 175.811 KB/sec
20745 root python eth0 2.449 45.715 KB/sec
11934 www-da.. nginx: worker process eth0 131.580 20.238 KB/sec
25925 root /usr/bin/python eth0 3.674 10.090 KB/sec
When
nethogs
is open, you can press r
in order to sort based on RECEIVED
or press s
to sort based on SENT
packets. To change the mode that it is shown for KB/sec
press m multiple times and see the output.#network #sysadmin #linux #nethogs #nethog #network #eth0