Skip to content

Instantly share code, notes, and snippets.

View romanbonapart's full-sized avatar
🐒
Busy

Roman Bonapart romanbonapart

🐒
Busy
View GitHub Profile
@romanbonapart
romanbonapart / fixfailedmountdevsda3.sh
Last active December 12, 2017 18:31
Fix Unable to Mount /dev/sda3 on Ubuntu
# This problem appears after failed safe shutdown if you use windows beside Ubuntu,
# sometimes you need to logged in in windows then do a safe shut down.
# but, how if you cannot do these step just run this simple command on terminal.
$ sudo ntfsfix /dev/sda3
@romanbonapart
romanbonapart / source.list
Created March 17, 2016 05:02
Indonesian Ubuntu 14.04 Local repository list
Telkom
deb http://dl2.foss-id.web.id/ubuntu/ trusty main restricted universe multiverse
deb http://dl2.foss-id.web.id/ubuntu/ trusty-updates main restricted universe multiverse
deb http://dl2.foss-id.web.id/ubuntu/ trusty-security main restricted universe multiverse
deb http://dl2.foss-id.web.id/ubuntu/ trusty-backports main restricted universe multiverse
deb http://dl2.foss-id.web.id/ubuntu/ trusty-proposed main restricted universe multiverse
ITB
deb ftp://ftp.itb.ac.id/pub/ubuntu trusty main restricted universe multiverse
deb ftp://ftp.itb.ac.id/pub/ubuntu trusty-updates main restricted universe multiverse
@romanbonapart
romanbonapart / docker-kill
Created October 25, 2016 14:59
Kill all docker container
stop all containers:
docker kill $(docker ps -q)
remove all containers
docker rm $(docker ps -a -q)
remove all docker images
docker rmi $(docker images -q)
@romanbonapart
romanbonapart / Vagrantfile
Created January 4, 2017 06:29
Vagrantfile using private ip
# -*- mode: ruby -*-
# vi: set ft=ruby :
# General project settings
#################################
# IP Address for the host only network, change it to anything you like
# but please keep it within the IPv4 private network range
ip_address = "10.0.1.2"
@romanbonapart
romanbonapart / exited-docker-remover.sh
Created February 17, 2017 08:14
One liner task to remove exited docker
sudo docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs sudo docker rm
@romanbonapart
romanbonapart / process-kill.sh
Created April 13, 2017 07:58
Kill process contain defined string
#!/bin/bash
for pid in $(ps -ef | awk '/some search/ {print $2}'); do kill -9 $pid; done
@romanbonapart
romanbonapart / helpers.php
Created April 16, 2017 06:01
Laravel 5.4 Active Route Helper in app/Http/helpers.php
<?php
/*
|--------------------------------------------------------------------------
| Detect Active Route
|--------------------------------------------------------------------------
|
| Compare given route with current route and return output if they match.
| Very useful for navigation, marking if the link is active.
|
@romanbonapart
romanbonapart / ec2.py
Created February 20, 2018 16:03
EC2 external inventory script
#!/usr/bin/env python
'''
EC2 external inventory script
=================================
Generates inventory that Ansible can understand by making API request to
AWS EC2 using the Boto library.
NOTE: This script assumes Ansible is being executed where the environment
@romanbonapart
romanbonapart / ec2.ini
Created February 20, 2018 16:06
Ansible EC2 external inventory script settings
# Ansible EC2 external inventory script settings
#
[ec2]
# to talk to a private eucalyptus instance uncomment these lines
# and edit edit eucalyptus_host to be the host name of your cloud controller
#eucalyptus = True
#eucalyptus_host = clc.cloud.domain.org
@romanbonapart
romanbonapart / update-lambda-rate.sh
Created January 22, 2019 05:38
Update cloudwatch event rate to execute lambda function
#Update cloudwatch event rate to execute lambda function
aws events put-rule --name <rule-name-from-previous-step> --schedule-expression "rate(15 minutes)" --state ENABLED --description "Invoke Pricing Calculator Lambda function every 15 minutes"