Audio

  • audacity apt-get install audacity

Video

Etc

Don't Log :

    
      SetEnvIf Remote_Addr "^((127\.0\.0\.1)|(\:\:1)|(192\.168\.1\.[1-2][0-5]?[0-6]))$" dontlog
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined env=!dontlog
    
  

After first install:

  • a2enmod rewrite
  • a2ensite default-ssl.conf
  • rm /var/www/html -rf && ln -s /path/to/html /var/www/html
  • Add <Directory ...> to /etc/apache2/sites-available/default-ssl.conf

command using dd:

umount /dev/sd<?><?>
dd bs=4M if=path/to/input.iso of=/dev/sd<?> conv=fdatasync  status=progress

Reference: https://askubuntu.com/questions/372607/how-to-create-a-bootable-ubuntu-usb-flash-drive-from-terminal
Search and replace (RegExp)

/* Tips:
 * Backup file or folder before using sed
 * Make sure RegEx script is working with trying it on single file (dummy file/copied one)
 */

// sed single file using regex to remove match string
sed -i -E 's/<script.*?netbro_cache_analytics.*?<\/script>//' ./documentation.html

// adding g at the end of 'pattern' to make it global or match more than 1 occurance, example:
sed -i -E 's/&lt.*?class=\"elements-to-be-removed\.*?\/div>//g' ./documentation.html

// using `find` to search more than 1 files:
find path/to/folder -type f -iname "*.php" -exec sed -i -E 's/<script.*?netbro_cache_analytics.*?<\/script>//' {} \;

// Escape quote ( ' )
sed -i -E 's/'"'"'base_url'"'"' => base_url\(\)/'"'"'base_url'"'"' => base_url\(\),\n\t'"'"'asset_url'"'"' => asset_url\(\)/' ./Controller.php
Sed Help
sed --help
Usage: sed [OPTION]... {script-only-if-no-other-script} [input-file]...

  -n, --quiet, --silent
                 suppress automatic printing of pattern space
      --debug
                 annotate program execution
  -e script, --expression=script
                 add the script to the commands to be executed
  -f script-file, --file=script-file
                 add the contents of script-file to the commands to be executed
  --follow-symlinks
                 follow symlinks when processing in place
  -i[SUFFIX], --in-place[=SUFFIX]
                 edit files in place (makes backup if SUFFIX supplied)
  -b, --binary
                 open files in binary mode (CR+LFs are not processed specially)
  -l N, --line-length=N
                 specify the desired line-wrap length for the 'l' command
  --posix
                 disable all GNU extensions.
  -E, -r, --regexp-extended
                 use extended regular expressions in the script
                 (for portability use POSIX -E).
  -s, --separate
                 consider files as separate rather than as a single,
                 continuous long stream.
      --sandbox
                 operate in sandbox mode (disable e/r/w commands).
  -u, --unbuffered
                 load minimal amounts of data from the input files and flush
                 the output buffers more often
  -z, --null-data
                 separate lines by NUL characters
      --help     display this help and exit
      --version  output version information and exit

If no -e, --expression, -f, or --file option is given, then the first
non-option argument is taken as the sed script to interpret.  All
remaining arguments are names of input files; if no input files are
specified, then the standard input is read.

GNU sed home page: <https://www.gnu.org/software/sed/>.
General help using GNU software: <https://www.gnu.org/gethelp/>.
E-mail bug reports to: <bug-sed@gnu.org>.
composer about
composer self-update
composer require <vendor/packagename>
composer global require <vendor/packagename>

See the previouse step here.

First,
apt-get install git-core # maybe suggest installing "git" without "-core"

Next step, i forget..


# SSH Section unstable tutorial, so keep it in mind.
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub && ssh git@ipaddress "cat >> ~/.ssh/authorized_keys"

# Creating repo (Server side)
inside /home/git
mkdir repo
cd repo
mkdir test.git
git init --bare test.git
cd test.git
git remote add origin git@ipaddress:repo/test.git

# Clone repo (Client side)
cd
mkdir gitlocal
cd gitlocal
git clone git@ipaddress:repo/test.git
# Enter password (it should suing id_rsa.pub rather than login from ssh)

These must be fixed later...
Ingredients:
0. Main OS
1. Have an .iso file for the latest version of Ubuntu Server (download here)
2. Have an Virtual Box inside your Debian (I'm using Kali Linux)
* why using virtual?
* we can modify anything even that Operating System is broken, we just need to reinstall without worrying "Whooaa!! I forget to backup my latest documents... Shit!!"


Steps for creating new virtual machine:
1. Create new OS
2. Name it as Ubuntu Server
3. See addition setting like x32/x64 is match or not with your .iso file
4. Next and follow the recommend setting
5. Wait! You need set your VM path inside your main OS, so it's not eat the Main System Storage

Installing Ubuntu Server:
1. Run the Virtual Ubuntu Server in your Virtual Box
2. Follow the instruction
3. Use entire disk (or else for advanced)
4. Setup name, hostname, username, password
5. Mark as checked for "Ubuntu Server Featured Snaps", may be like these package:
- postgresql
- i forget
- i forget, later will be updated..

Setup network adapter to connect between main OS and Virtual OS:
0. Shutdown the Virtual OS (if it's running)
1. Open your Virtual Box app
2. Select the OS and click Settings
3. Open Network menu and choose Adapter 2
4. Select "Host-only Adapter" on field "Attached to" 
5. Select "vboxnet0" on field "Name"
6. Save/OK
7. Run the OS
--------- separator --------
IP Addressing Section
--------- separator --------
8. Login and sudo su
9. Ifconfig and check the interface that was not have and IP address
9b. Remember the interface name, i think the name is 'enp0s8', right?
10. Edit network interfaces using : $ vim /etc/network/interfaces
10b. Write like this:
```
auto enp0s8
iface enp0s8 inet dhcp
```
11. Save and exit vim
12. Restart networking using `service networking restart`
# apt-get install ifupdown # may it needed


Done


Test ping between main OS and Virtual OS


This step is required for the next article.


When i using composer, node, npm, ionic, and other frameworks to install or update some packages, it will checking for the resources availbility on server and it take so long even your network is okay for opening website like Google and YouTube.

Solution is update your dns-nameserver using default DNS that your router get from the ISP. Some people still using 8.8.8.8 or 8.8.4.4 as the dns-nameserver configuration.

For the primary DNS you can set with 192.168.1.1 (your network gateway)  and let the router retrieve the default DNS from the ISP. For the second DNS you can set with Google DNS or else.

Some command to check your network:
# ifconfig (Linux) / ipconfig (Windows)

Your wifi's configuration for ssid and password that generated using wpa_passphrase is surely right, router configuration and your network interface setting not the problem.

So, check this file "/etc/dbus-1/system.d/wpa_supplicant.conf". If there is a 'epitest' word in there, do a backup for this file and edit after it. Delete all 'epitest' word on that file and save. Make sure there is no double dot (.) after you delete the 'epitest' word.

After that, run `killall wpa_supplicant` and `wpa_supplicant -B -i wlan0 -Dwext -c /etc/wpa_supplicant.conf`. If there is an error with parameter, run again without `-B` and open new terminal for run another command, that is `dhclient wlan0` and wait until dhclient command was done.

Finally, check `ipconfig` and make sure your wlna0 success getting ip from the rotuer/hotspot/access point.