Skip to content

Instantly share code, notes, and snippets.

View cuongnv23's full-sized avatar
๐Ÿƒ

cuongnv23

๐Ÿƒ
View GitHub Profile
@cuongnv23
cuongnv23 / chiasenhac-dowloader.py
Created June 20, 2016 10:38
Python script to download mp3 files from chiasenhac.com
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import re
import argparse
import errno
import requests
from bs4 import BeautifulSoup
@cuongnv23
cuongnv23 / ansinit
Created May 10, 2016 14:36
ansible-playbook-init
#!/usr/bin/env bash
ANS_FILES="inventory site.yml config.yml"
ANS_DIRS="group_vars host_vars roles yml"
for f in ${ANS_FILES}; do
echo "touch ${f}"
touch ${f}
done
@cuongnv23
cuongnv23 / ansible-linefile-endofline
Last active March 28, 2018 19:00
Ansible - Insert to end of line with lineinfile module
#handlers/main.yml
---
- name: Restart apache
service: name=apache2 state=restarted enabled=yes
tags:
- apache
#task/main.yml
---
- name: Enable apache modules
lineinfile: >
@cuongnv23
cuongnv23 / ansrole.sh
Last active March 10, 2016 09:57
Tiny script create ansible role dirs
#!/bin/sh
### Simple shell script to create Ansible role folders
sub_dirs="meta tasks vars handlers templates"
[ -z "$1" ] && echo "Usage: $0 your_role " && exit 1
for role in "$@"; do