$ npm ls -gp --depth=0 | awk -F/ '/node_modules/ && !/\/npm$/ {print $NF}' | xargs npm -g rm
This file contains 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
--- | |
- hosts: localhost | |
tasks: | |
- name: Search and Replace string | |
shell: for i in /home/sibunglon/*yml; do sed -i 's/search/replace/g' "$i"; done |
This file contains 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
--- | |
- hosts: localhost | |
tasks: | |
- name: Get Time by timezone | |
shell: TZ=Asia/Jakarta date '+%Y-%m-%d %H:%M:%S' | |
register: timeByTimezone | |
- debug: | |
msg: "{{timeByTimezone}}" |
This file contains 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
[Unit] | |
Description=Syrax Service | |
After=syslog.target | |
[Service] | |
WorkingDirectory=/deployments/syrax | |
ExecStart=/deployments/syrax/env/bin/python main.py SuccessExitStatus=143 | |
[Install] | |
WantedBy=multi-user.target |
This file contains 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/bash | |
for i in {11..20} | |
do | |
sudo timedatectl set-time "2020-07-$i 09:00:00" | |
echo "time now 2020-07-$i" | |
sleep 300 | |
done |
This file contains 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
import time | |
def get_time(): | |
print (time.strftime('%m-%d-%Y %H:%M:%S')) | |
get_time() |
This file contains 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
import os | |
def createFolder(directory): | |
try: | |
if not os.path.exists(directory): | |
os.makedirs(directory) | |
except OSError: | |
print ('Error: Creating directory. ' + directory) | |
- Create new file cockpit.conf on
/etc/cockpit
, and enter following script in tocockpit.conf
.
[WebService]
AllowUnencrypted=true
- Update or Create new file conf nginx for access cockpit.
map $http_upgrade $connection_upgrade {
default upgrade;
(env) ~/sibunglon/gist ❯❯❯ ansible-playbook main.yml
PLAY [localhost] *******************************************************************************************************************************************************************************************
TASK [Load Variable 1] *************************************************************************************************************************************************************************************
ok: [localhost] => {
"msg": "example.com/x"