This file contains hidden or 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
| How to conserve battery power using laptop-mode | |
| ----------------------------------------------- | |
| Document Author: Bart Samwel (bart@samwel.tk) | |
| Date created: January 2, 2004 | |
| Last modified: December 06, 2004 | |
| Introduction | |
| ------------ |
This file contains hidden or 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
| ThinkPad ACPI Extras Driver | |
| Version 0.25 | |
| October 16th, 2013 | |
| Borislav Deianov <borislav@users.sf.net> | |
| Henrique de Moraes Holschuh <hmh@hmh.eng.br> | |
| http://ibm-acpi.sf.net/ | |
This file contains hidden or 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
| # Create a user with Login | |
| sql = [%(CREATE ROLE <username> WITH PASSWORD '<password>' LOGIN)] | |
| # # Allow to connect | |
| sql << %(GRANT CONNECT ON DATABASE reports TO <username>) | |
| # # Allow to use schema | |
| sql << %(GRANT USAGE ON SCHEMA public TO <username>) | |
| # # grant on current objects | |
| sql << %(GRANT SELECT ON ALL TABLES IN SCHEMA public TO <username>) | |
| # # grant on future objects | |
| sql << %(ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO <username>) |
This file contains hidden or 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
| 1. Convert PEM into pub SSH key file: | |
| ssh-keygen -e -f amazon-ec2-key.pem >> amazon-ec2-key.pem.pub | |
| 2. Generate a PEM from a SSH key: | |
| openssl rsa -in my_tunneler -outform pem > my_tunneler.pem |
This file contains hidden or 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
| CREATE USER '<username>'@'%' IDENTIFIED BY '<password>'; | |
| # ALL PRIVILEGES is everything except grant | |
| GRANT ALL PRIVILEGES ON <database_name>.* TO '<username>'@'%'; | |
| GRANT SELECT ON <database_name>.* TO '<username>'@'%'; | |
| GRANT SELECT ON <database_name>.* TO '<username>'@'%'; |
This file contains hidden or 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
| SELECT table_schema "Data Base Name", SUM( data_length + index_length) / 1024 / 1024 | |
| "Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema ; |
This file contains hidden or 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
| ## Start SSH agent | |
| eval "$(ssh-agent -s)" | |
| ## Open SSH tunnel on port 3307 | |
| ssh -fN -L 3307:127.0.0.1:3306 sqlaccount@domain.com | |
This file contains hidden or 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
| showips() { | |
| NAMES=( $($IFC | grep "lo\|eth\|wlan" -A 1 | awk -F" " '{print $1 }' | grep -v "inet\|-\|UP" | sort -u) ) | |
| for i in "${NAMES[@]}" | |
| do | |
| echo "$i has ip address: `$IFC | grep "$i" -A 1 | grep "addr" | awk -F" " '{print $2}' | awk -F":" '{print $2}'`" | |
| done | |
| } |
This file contains hidden or 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 | |
| if [ "$1" != "" ]; then | |
| case $1 in | |
| -o | --open ) echo "$USER opening sshfs connection" | |
| open your connection here | |
| ;; | |
| -c | --close ) echo "$USER closing sshfs connection" | |
| close your connection here | |
| ;; |
This file contains hidden or 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
| # Ruby prerequisites | |
| sudo apt-get update | |
| sudo apt-get install -y git gcc make libssl-dev libreadline-dev zlib1g-dev | |
| # Native gem extensions prerequisites | |
| sudo apt-get install -y g++ | |
| #Install Ruby using rvm | |
| sudo apt-get install -y libgdbm-dev libncurses5-dev automake libtool bison libffi-dev | |
| gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 |