Quantcast
Channel: d0wn
Browsing all 73 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

BASH : IP validation 

if you have a list of ip to validate , you can use this little bash script , this will open your IP list , then test if all the 4 numbers that make a standard IP.are beeten 0 and 255 if the ip is...

View Article


Image may be NSFW.
Clik here to view.

BASH : Comparison of values

In a if test, you often have to compare the value of two variable of the value a variable against a fixed value is equal to if [ "$a" -eq "$b" ] if [ "$a" -eq "35" ] . not equal to if [ "$a" -ne "$b"...

View Article


Image may be NSFW.
Clik here to view.

BASH : Make a SQL query from bash

MySQL is a very convenient way to store data . To use stored MySQL data in a BASH script you can use this simple command echo "SELECT * FROM table WHERE column=xyz | MYSQL_PWD=sqlpassword mysql...

View Article

Image may be NSFW.
Clik here to view.

BASH:check if a number is even or odd

In a bash script you might need to check if a var is even or odd ,  in my case im going to use a if to make that check #!/bin/bash for i in $(seq 10);do     if (( $i % 2 )); then         echo $i is...

View Article

Image may be NSFW.
Clik here to view.

Bash script to clean movies name

The issue when you download movies online, is that most of the time the file name is going to be complete trash , filled with useless info like the team that made the rip or the website from where the...

View Article


Image may be NSFW.
Clik here to view.

Libre Computer Board a nice 4K capable SBC

Kickstarter spawned a very interesting board , it’s called Le Potato from the company Libre Computer Board this board is designed to offer exactly the same layout as the RPI3 , but absolutely destroy...

View Article

Image may be NSFW.
Clik here to view.

The NanoPI NEO Plus 2

the guys at Frendly elec Just created a very interesting board witch check a lots of mark in the things I look for in a SBC, First : a good CPU the Allwinner H5 , is a powerful enough CPU that you...

View Article

OrangePI : Install OpenRTSP on a ARM device

One of my project with my OrangePI is to setup the device as a basic IP security camera server , the OrangePI zero , will connect to RTSP flux of the IP camera , and dump the stream on to an external...

View Article


Image may be NSFW.
Clik here to view.

Orange PI Zero Plus – A simple and, powerfull SBC

if you follow what’s new in the SBC world. You must know Xunglong Orange pi, they are a Chinese manufacturer known for making very cheap sbc’s based on Allwinner chip’s. One of their most interesting...

View Article


Image may be NSFW.
Clik here to view.

InfluxDB insert multiples values at once using curl

If you have to insert multiples values in an influxdb database. You can use curl and insert the values one at the time. But there is a better way like in this example Let’s say you want to insert your...

View Article

grafana service doesn’t auto start with the system

When installing grafana and influxDB. I encountered the folowing issue The service of grafana and influxDB where not starting . service grafana-server status grafana-server.service - Starts and stops a...

View Article

Image may be NSFW.
Clik here to view.

Orange pi zero – the battle against HEAT

As you know if you own the orange pi zero, the board run very hot. Running it without an heat sink is not really possible if your board is doing anything other than idling and even with an heatsink you...

View Article

Redirect stdout and stderr to a file

il you need to run a script unattended and wish to log the output of that script you must already know that you can simply do ./myscript.sh > mylog.log the problem with that is you will not log the...

View Article


Bash brace expansion. (to delete files)

In bash , it is common to have to do some action on a numéric serie of files , like deleting or renaming , Using brace expansion you will be able to générate a single line that will act on multiple...

View Article

Bash keyboard shortcuts

When you are spending your day in the terminal , you will find that navigating using only the arrows keys although fine at the the start will frustrate you because it’s quite slow. Bash come with a lot...

View Article


Use the keyboard on a remote machine over SSH?

If you use a Linux box to display some infos in a public space , you might not have the possibility to connect a mouse and keyboard every time you need to click on the page. For example, at work we use...

View Article

How to update Grafana from version 4 to version 5

Grafana is a wonderful tool to display time series ans a lot of different metrics The project is in a very active development state , and new features are added constantly. The version 5 is...

View Article


Image may be NSFW.
Clik here to view.

Bash – Loop over the contents of a file line by line

If you need to iterate over the content of a file line by line You can use this little bash trick. while read -r line; do printf '%s\n' "$line" done < "file.txt" In this case , it will simply print...

View Article

Using AWK to display the min the max and the average of a list

awk is a extremely powerful tool ! i’m always surprised how much you can do with it. My latest finding is pretty amazing. Lets say you have a list of numbers , and you want to figure out the bigger...

View Article

bash : Random number in OpenWRT

On some light linux environement running busybox or openWRT you will notice that you don’t have access to the $RANDOM variable , the date command is also incomplete so you can’t use the tail of the...

View Article
Browsing all 73 articles
Browse latest View live