Bagaimana me-resize Gambar menggunakan Imagemagic di Ubuntu

Syarat untuk dapat menjalankan perintah dibawah ini, adalah ubuntu anda harus sudah terinstall Imagemagic, apabila sudah terinstall jalankan perintah ini untuk me-resize image.

convert -resize 50% image.jpg image.jpg

Apabila files imagenya lebih dari satu anda dapat menjalankan perintah looping di bawah ini

for file in *.JPG; do convert $file -resize 50% resize-$file; done

Perintah diatas diartikan akan me-resize sebesar 50% setiap files yang memiliki tipe .JPG dan akan dibuatkan file baru dengan awalan resize-.

Untuk lebih detailnya anda bisa membacara artikel dibawah ini :

  1. https://www.howtogeek.com/109369/how-to-quickly-resize-convert-modify-images-from-the-linux-terminal/
  2. https://www.smashingmagazine.com/2015/06/efficient-image-resizing-with-imagemagick/

Semoga dapat membantu

Please follow and like us:
0

Simple step to check CGI Vuln on Nginx and how to fix it

Only adding this script on your /etc/nginx/fastcgi_params

# Fix Http_proxy a cgi app Vulnerability
fastcgi_param  HTTP_PROXY  "";

and you have  done.

But if you only want to check it on your server but you dont have mod cgi, just follow me :

 

http-proxy-welcome

 

1. Install fcgiwrap, su nginx support feature cgi

apt-get install fcgiwrap

After the installation, the fcgiwrap daemon should already be started; its socket is /var/run/fcgiwrap.socket. If it is not running, you can use the /etc/init.d/fcgiwrap script to start it.

Now open your vhost configuration file…

vi /etc/nginx/sites-enabled/default

… and add a location /cgi-bin {} section to the server {} container:

server {
[...]
location /cgi-bin/ {
# Disable gzip (it makes scripts feel slower since they have to complete
# before getting gzipped)
gzip off;
# Set the root to /usr/lib (inside this location this means that we are
# giving access to the files under /usr/lib/cgi-bin)
root  /var/www/html;
# Fastcgi socket
fastcgi_pass  unix:/var/run/fcgiwrap.socket;
# Fastcgi parameters, include the standard ones
include /etc/nginx/fastcgi_params;
# Adjust non standard parameters (SCRIPT_FILENAME)
fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name;
}
[...]
}

Reload nginx:

/etc/init.d/nginx reload

Next we create our cgi-bin directory – /var/www/html/cgi-bin because we defined root /var/www/html; in the location /cgi-bin {} container:

mkdir /var/www/html/cgi-bin

Now we place our CGI scripts in it and make them executable. For testing purposes I will create a small Hello World Perl script (instead of hello_world.cgi you can also use the extension .pl -> hello_world.pl):

vi /var/www/html/cgi-bin/hello_world.cgi
#!/usr/bin/perl -w
# Tell perl to send a html header.
# So your browser gets the output
# rather then <stdout>(command line
# on the server.)
print "Content-type: text/html\n\n";
# print your basic html tags.
# and the content of them.
print "<html><head><title>Hello World!! </title></head>\n";
print "<body><h1>Hello world</h1></body></html>\n";
chmod 755 /var/www/html/cgi-bin/hello_world.cgi

Open a browser and test the script:

http://yourdefaultwebsite/cgi-bin/hello_world.cgi

and you will see “Hello World” on your browser, and if you see it, congratulation you server nginx has support CGI.

2. how to check CGI VULN

To diagnose the issue, temporarily install the following as a CGI script on your server and make it executable:

create file test.cgi

vi /var/www/html/cgi-bin/test.cgi

and this is the content, only insert it and save it.

#!/bin/sh
echo "Content-Type:text/plain"
​echo ""
echo "HTTP_PROXY='$HTTP_PROXY'"

Then call the CGI script with a “Proxy:” request header:

curl -H ‘Proxy: AFFECTED’ http://yourdefaultwebsite/cgi-bin/test.cgi

If you see the following output, your server is unaffected:

HTTP_PROXY=”

If instead you see the following, or any other output, your server may be affected and you should apply one of the mitigations below:

HTTP_PROXY=’AFFECTED’

Thank you, hop this can you 🙂

Reference :

1. A CGI Vulnerability https://httpoxy.org/
2. HTTPoxy – CGI “HTTP_PROXY” variable name clash, https://access.redhat.com/security/vulnerabilities/httpoxy
3. HTTPOXY Vulnerability: How to protect and test your web server, https://www.howtoforge.com/tutorial/httpoxy-protect-your-server/

 

 

Please follow and like us:
0

Cara menambah size disk di debian

Mengalokasikan partisi disk tidak sesuai dengan kebutuhan memang merepotkan, dimana partisi dibuat sebesar 5GB ternyata kebutuhan lebih dari 5GB, maka solusinya adalah menambah size disk, sehingga partisi yang dialokasikan asalanya 5GB dapat diresize ke alokasi disk yg lebih besar lagi.

Tentunya dengan dapat mengextend disk mempermudah admin untuk tidak melakukan instalasi ulang untuk hanya menambah ukuran disk.

Dan berikut adalah video cara untuk exend disk :

 

 

Please follow and like us:
0