Tags » Bash Script

Binary Search Using Bash Script

Chắc hẳn dân IT đều biết thuật toán tìm kiếm nhị phân rồi. Thay vì viết bằng C hay Python, tôi quyết định viết bằng bash cho nó máu :D… 65 more words

Ubuntu

sudo asks for password even if NOPASSWD is set in /etc/sudoers

TL;DR when a script is not marked as executable and you try to run it with sudo, you don’t get the usual -bash: myScript.sh: Permission denied… 314 more words

Computers

The BASH shell, and basic needs

Now we can begin!

There are some prerequisites to operating within the shell in a ‘nix environment:

1. DO NO HARM!….. I know it sounds corny (korny?), but the first commandment of a ‘nix sysadmin is a big one, and not following it, particularly when possessing elevated or root privileges, can cost you time, money, effort, and possibly your job!… You ARE backing up, right? 187 more words

Linux/UNIX

Nmap - Scan for open ports

nmap is a network exploration tool and security/port scanner.

We can list all open ports using nmap for a given IP/Host.

Use following command to list all open ports: 32 more words

Ubuntu

mutt - send mails with attachments

By using mutt we can send mails with attachments from command line.

Install mutt:

$ apt-get install mutt

Send mail with attachment:

$ mutt -s "PFA" -a attachment.txt user@example.com < body.txt… 39 more words
Debian