This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql -h localhost -u root -proot -e "select * from file limit 10" -s -N | |
# -s --silent | |
# -N skip column names |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| | VM <-> Host | VM1 <-> VM2 | VM -> Internet | VM <- Internet | | |
|----------|-------------|-------------|----------------|----------------| | |
| HostOnly | Yes | Yes | No | No | | |
| Internal | No | Yes | No | No | | |
| Bridged | Yes | Yes | Yes | Yes | | |
| NAT | No | No | Yes | Port forward | | |
| NATNet | No | Yes | Yes | Port forward | | |
https://stackoverflow.com/a/54232899 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git checkout --orphan latest_branch | |
git add -A | |
git commit -am "<commit message>" | |
git branch -D master | |
git branch -m master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep -ri1 "pass" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: python:latest | |
stages: | |
- test | |
- flake8 | |
- build | |
- sonarqube | |
- deploy | |
variables: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import webbrowser | |
import sys | |
LIST_KELOMPOK = [] | |
# contain all group | |
with open('list_repo.txt') as f: | |
for line in f: | |
if "https" in line: | |
LIST_KELOMPOK.append(line.strip("\n")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# From https://www.hiroom2.com/2017/09/24/parrotsec-3-8-docker-engine-en/ | |
set -e | |
# Install dependencies. | |
sudo apt install -y curl apt-transport-https \ | |
software-properties-common ca-certificates | |
# Install docker. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# From https://www.hiroom2.com/2017/09/24/parrotsec-3-8-docker-engine-en/ | |
set -e | |
# Install dependencies. | |
sudo apt install -y curl apt-transport-https \ | |
software-properties-common ca-certificates | |
# Install docker. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bad | |
class LembagaViewByNama(RetrieveAPIView): | |
permission_classes = (IsAuthenticated, ) | |
authentication_class = JSONWebTokenAuthentication | |
def get(self, request, nama_lembaga): | |
nama = Lembaga.objects.get(nama_lembaga=nama_lembaga) | |
if nama != None: # jika semakin banyak conditional maka akan semakin sulit | |
serializer = LembagaSerializer(nama, context=serializer_context) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bad | |
name = "Cristiano Rolando" | |
def split_into_first_and_last_name(): | |
global name | |
name = name.split() | |
# ketika fungsi dieksusi akan merusak dari global variabel name | |
split_into_first_and_last_name() | |
print(name) |
NewerOlder