Skip to content

Instantly share code, notes, and snippets.

@pantasio
pantasio / profile.ps1
Created May 16, 2020 22:14 — forked from sixeyed/profile.ps1
PowerShell profile with a Linux-style prompt and aliases for common Docker commands
function Prompt(){
$W = Split-Path -leaf -path (Get-Location)
$prompt = Write-Prompt "$($env:UserName)@$($env:ComputerName):" -ForegroundColor Green
$prompt += Write-Prompt $W -ForegroundColor DarkCyan
$prompt += Write-Prompt '>'
return ' '
}
function Remove-StoppedContainers {
docker container rm $(docker container ls -q)
@pantasio
pantasio / .gitconfig
Created May 16, 2020 22:02 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
@pantasio
pantasio / container_ip.bash
Created September 2, 2019 19:14 — forked from zainengineer/container_ip.bash
Get docker container ip
#!/usr/bin/env bash
#inside docker container
HOST_IP=$(/sbin/ip route|awk '/default/ { print $3 }')
CONTAINER_IP=$(curl "$HOST_IP:8000" 2>/dev/null)
echo "container ip is $CONTAINER_IP"
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provider "virtualbox" do |vb|
vb.gui = false
vb.name = "docker-example-vm"
vb.memory = "1024"
vb.cpus = 1
end
config.vm.provision "docker" do |d|
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provider "virtualbox" do |vb|
vb.gui = false
vb.name = "docker-example-vm"
vb.memory = "1024"
vb.cpus = 1
end
config.vm.provision "docker" do |d|
@pantasio
pantasio / vagrant file example1
Created April 25, 2019 15:49
vagrant file example1
VAGRANTFILE_API_VERSION = "2"
BASE_LOCAL_IP = "192.168.33"
BASE_START_IP = 101
MASTER_NODE_IP = "#{BASE_LOCAL_IP}.101"
$num_slaves = 2
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
@pantasio
pantasio / 69-libmtp.rules
Created March 30, 2018 10:43
/lib/udev/rules.d/69-libmtp.rules
#https://forum.xda-developers.com/oneplus-3/how-to/guide-connect-op3-mtp-linux-ubuntu-t3402472
Unable to open ~/.mtpz-data for reading, MTPZ disabled.# UDEV-style hotplug map for libmtp
# Put this file in /etc/udev/rules.d
ACTION!="add", GOTO="libmtp_rules_end"
ENV{MAJOR}!="?*", GOTO="libmtp_rules_end"
SUBSYSTEM=="usb", GOTO="libmtp_usb_rules"
GOTO="libmtp_rules_end"
LABEL="libmtp_usb_rules"
@pantasio
pantasio / enable USB debug.adb
Created March 29, 2018 08:20
adb cmd enable USB debug cant touch screeen
I got it to work :)
NOTE: This requires unlocked bootloader.
Connect the device to Mac or PC in recovery mode. (I had to map the process in my mind as the screen was broken).
Now open terminal/CMD in computer and go to platform-tools/. type and enter ./adb devices to check if the device is connected in recovery mode.
Now type ./adb shell mount data and ./adb shell mount system to mount the respective directories.
Get the persist.sys.usb.config file in your system using ./adb pull /data/property/persist.sys.usb.config /Your directory
Now open that file in a texteditor and edit it to mtp,adb and save.
Now push the file back in the device; ./adb push /your-directory/persist.sys.usb.config /data/property
@pantasio
pantasio / AdbCommands
Created March 29, 2018 07:07 — forked from Pulimet/AdbCommands
Adb useful commands list
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell
@pantasio
pantasio / nginx_basics.md
Created March 9, 2016 10:14 — forked from leommoore/nginx_basics.md
Nginx Basics

#Nginx Basics for Ubuntu

Please see http://wiki.nginx.org/Main for more information. See http://arstechnica.com/gadgets/2012/11/how-to-set-up-a-safe-and-secure-web-server/ for a tutorial on how to install Nginx.

##Installation To install, you can install the version which is in the standard Ubuntu repositories but it is normally quite old and will not have the latest security patches. The best way is to update the repositories first:

apt-get update
apt-get install python-software-properties

apt-get upgrade