Skip to content

Instantly share code, notes, and snippets.

View danielcosta's full-sized avatar

Daniel Costa danielcosta

View GitHub Profile
@danielcosta
danielcosta / docker-compose.sh
Created April 7, 2017 15:18
Run docker-compose inside a container
#!/bin/bash
#
# Run docker-compose in a container
#
# This script will attempt to mirror the host paths by using volumes for the
# following paths:
# * $(pwd)
# * $(dirname $COMPOSE_FILE) if it's set
# * $HOME if it's set
#
@danielcosta
danielcosta / updateJetbrains.sh
Last active April 30, 2020 02:38
Script to update PhpStorm and others Jetbrains products
#!/usr/bin/env bash
VERSION_PATTERN="([0-9]+\.[0-9]+\.[0-9]+)"
case "${1}" in
"phpstorm")
TOOL_NAME="PhpStorm"
INSTALL_DIR="/opt/phpstorm"
case "${2}" in
"eap")
@danielcosta
danielcosta / install-teamviewer.sh
Created July 10, 2017 14:23
Install Teamviewer on Debian
sudo dpkg --add-architecture i386
sudo apt update
cd ~/Downloads
curl -L -o teamviewer_i386.deb "https://download.teamviewer.com/download/teamviewer_i386.deb"
sudo apt install -y ./teamviewer_i386.deb
rm teamviewer_i386.deb
@danielcosta
danielcosta / lint-php.sh
Last active July 19, 2017 14:31
Lint changed PHP files
#!/usr/bin/env bash
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
ANCESTOR=$(git merge-base $CURRENT_BRANCH master)
OIFS=$IFS
IFS=$'\n' FILES=($(git diff --name-status $ANCESTOR HEAD | grep -E '^[AM].+\.php$' | awk '{print $2}'))
IFS=$OIFS
php-lint.sh "${FILES[@]}"
@danielcosta
danielcosta / fix-mic-volume.md
Created June 30, 2022 15:31
Microphone settings for Linux

Fix Microphone Volume - or stop it from auto-adjustment

Check current volume

To see the current volume, run alsamixer. Let's consider the current volume shown is 40.

How to determine the .conf file for your microphone

Run pacmd list-sources.