BLπŸ…ΎG News


Actu G33k & admin stuff.

β‹… Aucun commentaire

Ping command

Jumbo Frames = 9100

Standard MTU = 1500 ( but with 1400 should be good for all )

Short Frames = 64

Linux:

ping -M do -s [FRAME] [IP]

[ -M "do/dont/want" ] define mtu discovery, can be one of ("do|dont|want")

[ -s "size"] use as number of data bytes to be sent


ping -M do -s 1400 1.1.1.1

PING 1.1.1.1 (1.1.1.1) 1400(1400) bytes of data.
1478 bytes from 1.1.1.1: icmp_seq=1 ttl=54 time=5.22 ms

Windows:

ping [IP] -f -l [FRAME]

[ -f ] Active l’indicateur Ne pas fragmenter dans le paquet (IPv4 uniquement).

[ -l "size" ] Taille du tampon d’envoi.

ping 1.1.1.1 -f -l 1400

Envoi d’une requΓͺte 'Ping'  1.1.1.1 avec 1400 octets de donnΓ©esΒ :
RΓ©ponse de 1.1.1.1Β : octets=1400 temps=2 ms TTL=60
 

Mac OSX:

ping -D -s 9100 [destinationIP]

HELP COMMAND

Linux

ping -h

Usage
  ping [options] <destination>

Options:
  <destination>      dns name or ip address
  -a                 use audible ping
  -A                 use adaptive ping
  -B                 sticky source address
  -c <count>         stop after <count> replies
  -D                 print timestamps
  -d                 use SO_DEBUG socket option
  -f                 flood ping
  -h                 print help and exit
  -I <interface>     either interface name or address
  -i <interval>      seconds between sending each packet
  -L                 suppress loopback of multicast packets
  -l <preload>       send <preload> number of packages while waiting replies
  -m <mark>          tag the packets going out
  -M <pmtud opt>     define mtu discovery, can be one of <do|dont|want>
  -n                 no dns name resolution
  -O                 report outstanding replies
  -p <pattern>       contents of padding byte
  -q                 quiet output
  -Q <tclass>        use quality of service <tclass> bits
  -s <size>          use <size> as number of data bytes to be sent
  -S <size>          use <size> as SO_SNDBUF socket option value
  -t <ttl>           define time to live
  -U                 print user-to-user latency
  -v                 verbose output
  -V                 print version and exit
  -w <deadline>      reply wait <deadline> in seconds
  -W <timeout>       time to wait for response

IPv4 options:
  -4                 use IPv4
  -b                 allow pinging broadcast
  -R                 record route
  -T <timestamp>     define timestamp, can be one of <tsonly|tsandaddr|tsprespec>

IPv6 options:
  -6                 use IPv6
  -F <flowlabel>     define flow label, default is random
  -N <nodeinfo opt>  use icmp6 node info query, try <help> as argument

By
πŸ…΄πŸ†πŸ†πŸ…΄πŸ†„πŸ†32
On
πŸ†“πŸ…΄πŸ…²πŸ…·πŸ…ΎοΈπŸ†‚πŸ†ˆπŸ†‚πŸ†ƒπŸ…΄πŸ…Ό



β‹… Aucun commentaire

How to make your .deb

You can use this little script

function MONDEB(){

# Go to your repository 
cd /home/tools/MONDEB/bashelper
# make .deb file
dpkg-deb --build bashelper
# copy .deb on the right place (MONREPO).
cp /home/tools/MONDEB/bashelper/bashelper.deb /home/tools/MONREPO/bashelper/ -f
}

function cdrepo() {
# go to the web repo
cd /home/tools/MONREPO/bashelper/

# Delete old files
rm -rf /home/tools/MONREPO/bashelper/db
rm -rf /home/tools/MONREPO/bashelper/pool
rm -rf /home/tools/MONREPO/bashelper/dists
rm -f  /home/tools/MONREPO/bashelper/public.key

# Make the magic
reprepro -b . includedeb stable  /home/tools/MONREPO/bashelper/bashelper.deb

# Done !
}


MONDEB
echo " βœ…DEB   update  OK "

cdrepo
echo " βœ…REPO update OK "

echo " gpg starting ... need to put your secret"
/usr/bin/gpg --armor --output /home/tools/MONREPO/bashelper/public.key --export contact@echosystem.fr

Make REPOSITORY for web APT

Exemple of Apache Sub-domain:

 
<VirtualHost *:80>
ServerName deb.echosystem.fr
RedirectPermanent / https://deb/echosystem.fr/
</VirtualHost>

<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerName deb.echosystem.fr
        ServerAdmin contact@echosystem.fr
        DocumentRoot /home/tools/MONREPO
        Serversignature off
 
# SSL
SSLEngine On
SSLHonorCipherOrder on
SSLCompression    off
SSLCertificateFile /etc/letsencrypt/live/deb.echosystem.fr/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/deb.echosystem.fr/privkey.pem

##Secu
SetEnv nokeepalive ssl-unclean-shutdown

<IfModule mod_headers.c>
    Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"
    Header always set X-Frame-Options SAMEORIGIN
    Header always set X-Xss-Protection "1; mode=block"
    Header always set X-Content-Type-Options nosniff
   Header always set Referrer-Policy origin
</IfModule>

<Directory /home/tools/MONREPO>
 Options +Indexes +FollowSymLinks
  Require all granted
  RewriteEngine On
  AllowOverride None

IndexOptions FancyIndexing HTMLTable SuppressRules
IndexOptions IconsAreLinks ScanHTMLTitles NameWidth=* DescriptionWidth=*

# Autoindex-Strapdown Directives
AddType text/plain .md
HeaderName HEADER.md
ReadmeName README.md

IndexHeadInsert "<script>conf = {theme: 'cyborg', title: 'Repository APT  ☠'};</script> \
<script src='/autoindex_strapdown/autoindex_strapdown.js'></script> \
<link rel='stylesheet' href='/autoindex_strapdown/autoindex_strapdown.css'>"

# Turn off index.html rendering, so Strapdown directory is autoindexed
#DirectoryIndex no-such-file.html

# Override common defaults on Mac OS X
AddIconByEncoding (CMP,/autoindex_strapdown/icons2/glyphicon-file.svg) x-compress x-gzip
AddIcon /autoindex_strapdown/icons2/glyphicon-file.svg .bin .exe .hqx .tar .wrl .wrl.gz .vrml .vrm .iv .Z .z .tgz .gz .zip .ps .ai .eps .html .shtml .htm .pdf .txt .c .pl .py .for .dvi .uu .conf .sh .shar .csh .ksh .tcl .tex core

# Descriptions
AddDescription "tl;dr: Apache, use freely"
AddDescription "tl;dr: MIT, use freely" LICENSE
AddDescription "SVG file icons" icons

# Icons using Bootstrap's Glyphicon set
DefaultIcon /autoindex_strapdown/icons2/glyphicon-file.svg
AddIcon /autoindex_strapdown/icons2/blank.svg ^^BLANKICON^^
AddIcon /autoindex_strapdown/icons2/glyphicon-folder-open.svg ^^DIRECTORY^^
AddIcon /autoindex_strapdown/icons2/glyphicon-circle-arrow-up.svg ..
AddIconByType (TXT,/autoindex_strapdown/icons2/glyphicon-file.svg) text/*
AddIconByType (IMG,/autoindex_strapdown/icons2/glyphicon-picture.svg) image/*
AddIconByType (SND,/autoindex_strapdown/icons2/glyphicon-music.svg) audio/*
AddIconByType (VID,/autoindex_strapdown/icons2/glyphicon-film.svg) video/*

# Exclusions
IndexIgnore robots.txt pic favicon.ico favicon.gif HEADER.md README.md autoindex_strapdown  themes js .htaccess  favicon.png update-repo.sh update-repo-bashelper.sh
</Directory>

<link rel='stylesheet' href='/autoindex_strapdown/autoindex_strapdown.css'>"

# debug, info, notice, warn, error, crit, alert, emerg.
LogLevel notice

CustomLog ${APACHE_LOG_DIR}/access.deb.echosystem.fr.log vhost_combined
CustomLog ${APACHE_LOG_DIR}/404_only.log vhost_combined "expr=%{REQUEST_STATUS} eq 404"
CustomLog ${APACHE_LOG_DIR}/access.log vhost_combined
 
</VirtualHost>
</IfModule>


β‹… Aucun commentaire

#
# Disable access to the entire file system except for the directories that
# are explicitly allowed later.
#
# This currently breaks the configurations that come with some web application
# Debian packages.
#
#<Directory />
#   AllowOverride None
#   Require all denied
#</Directory>


# Changing the following options will not really affect the security of the
# server, but might make attacks slightly more difficult in some cases.

#
# ServerTokens
# This directive configures what you return as the Server HTTP response
# Header. The default is 'Full' which sends information about the OS-Type
# and compiled in modules.
# Set to one of:  Full | OS | Minimal | Minor | Major | Prod
# where Full conveys the most information, and Prod the least.
#ServerTokens Minimal
ServerTokens Prod
#ServerTokens Full

#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (internal error documents, FTP directory
# listings, mod_status and mod_info output etc., but not CGI generated
# documents or custom error documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of:  On | Off | EMail
#ServerSignature Off
ServerSignature Off

#
# Allow TRACE method
#
# Set to "extended" to also reflect the request body (only for testing and
# diagnostic purposes).
#
# Set to one of:  On | Off | extended
TraceEnable Off
#TraceEnable On

#
# Forbid access to version control directories
#
# If you use version control systems in your document root, you should
# probably deny access to their directories. For example, for subversion:
#
<DirectoryMatch "/\.svn">
   Require all denied
</DirectoryMatch>


#############################################
 
<DirectoryMatch "/\.git">
   Require all denied
</DirectoryMatch>

<Files ".ht*">
    Require all denied
</Files>

<Files "xmlrpc.php">
    Require all denied
</Files>

<Files "robots.txt">
    Require all granted
</Files>

#################################################
#
# Setting this header will prevent MSIE from interpreting files as something
# else than declared by the content type in the HTTP headers.
# Requires mod_headers to be enabled.
#
Header set X-Content-Type-Options: "nosniff"

#
# Setting this header will prevent other sites from embedding pages from this
# site as frames. This defends against clickjacking attacks.
# Requires mod_headers to be enabled.
#
#Header set X-Frame-Options: "sameorigin"


# vim: syntax=apache ts=4 sw=4 sts=4 sr noet


β‹… Aucun commentaire

Nano list rename function changelog

Changes between v4.9 and v5.0:
------------------------------
options: rename --tempfile to --saveonexit, to be far clearer

#set tempfile 
set saveonexit

Changes between v4.8 and v4.9:
------------------------------
options: rename --suspend to --suspendable, to make more sense

#set suspend 
set suspendable

Changes between v3.2 and v4.0:
------------------------------
options: actually rename --rebindkeypad to --rawsequences (-K)

#set rebindkeypad
set rawsequences

Changes between v2.8.5 and v2.8.6:
----------------------------------
options: rename --cut to --cutfromcursor, to be clearer

#set cut
set cutfromcursor

Source
https://www.nano-editor.org/dist/latest/ChangeLog




β‹… 1 commentaire

Fix - ERROR: unable to download video data: HTTP Error 403: Forbidden

logo

When you want to download a youtube video and you have this:

 $ youtube-dl  https://youtu.be/JkeE2O15RFs
   [youtube] JkeE2O15RFs: Downloading webpage
   ERROR: unable to download video data: HTTP Error 403: Forbidden
 

You can try to fix with 2 steps:

First update youtube-dl with -U

 $ sudo youtube-dl -U

And finally try to remove the cache , yes the cache ... with --rm-cache-dir

 $ youtube-dl --rm-cache-dir
    Removing cache dir /root/.cache/youtube-dl ...

Try now :

 $ youtube-dl  https://youtu.be/JkeE2O15RFs  --no-cache-dir  -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" 
    [youtube] JkeE2O15RFs: Downloading webpage
    [youtube] JkeE2O15RFs: Downloading js player vflset
    [youtube] JkeE2O15RFs: Downloading js player vflset
    [download] Destination: Beastie Boys - Alive (Official Music Video)-JkeE2O15RFs.f137.mp4
    [download] 100% of 68.01MiB in 00:06
    [download] Destination: Beastie Boys - Alive (Official Music Video)-JkeE2O15RFs.f140.m4a
    [download] 100% of 3.71MiB in 00:00
    [ffmpeg] Merging formats into "Beastie Boys - Alive (Official Music Video)-JkeE2O15RFs.mp4"
    Deleting original file Beastie Boys - Alive (Official Music Video)-JkeE2O15RFs.f137.mp4 (pass -k to keep)
    Deleting original file Beastie Boys - Alive (Official Music Video)-JkeE2O15RFs.f140.m4a (pass -k to keep)

You can put --no-cache-dir to your command to avoid this, or delete the cache.

 $ youtube-dl  https://youtu.be/JkeE2O15RFs  --no-cache-dir  
 alias ytdl='youtube-dl  -o "%(title)s.%(ext)s" --extract-audio --audio-format mp3 -k --force-ipv4  --rm-cache-dir $1'
 alias ytdlV='youtube-dl  -o "%(title)s.%(ext)s" --force-ipv4 $1'

First line download and keep both video and mp3.
Second line download and keep only vdieo.
Bonus: --rm-cache-dir Delete cache from video file.

Enjoy! :)

by πŸ…΄πŸ†πŸ†πŸ…΄πŸ†„πŸ†32
πŸ…΄πŸ…²πŸ…·πŸ”΅πŸ†‚πŸ†ˆπŸ†‚πŸ†ƒπŸ…΄πŸ…Ό