- htttp://ivanhuay.ar
- in/ivanhuay
This file contains 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 | |
FILE=$1 | |
if [ -f $FILE ]; | |
then | |
while read line | |
do | |
resp=`curl -s "http://freegeoip.net/json/$line"|grep -Eo "\"country_name\":\"[a-zA-Z\ ]{4,50}\""` | |
echo "$line $resp" |
This file contains 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 | |
USERBACKGROUND=$( gsettings get org.gnome.desktop.background picture-uri ) | |
IMAGES=("wallhaven-466058.png" "wallhaven-284216.jpg" "wallhaven-452660.jpg" "wallhaven-452652.jpg" "wallhaven-418590.jpg" "wallhaven-360663.jpg") | |
STARTTIME=5 | |
function getImages { | |
for i in ${IMAGES[@]}; do | |
echo "dowloading https://wallpapers.wallhaven.cc/wallpapers/full/${i} ..." |
This file contains 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 | |
COUNTER=0 | |
STARTWAIT=20 | |
echo "waiting $STARTWAIT seconds!" | |
sleep $STARTWAIT | |
echo "Random volumen >:D" | |
while true; do | |
echo "number: $COUNTER" | |
if [ $(( COUNTER % 2 )) -eq 0 ]; then | |
RANDOMPERCENT=$( node -e "console.log(Math.round(Math.random()*50)+10)" ) |
This file contains 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 | |
sudo apt-get update | |
sudo apt-get install nodejs -y | |
sudo apt-get install npm -y | |
sudo npm install -g n | |
sudo n latest | |
sudo npm install -g npm | |
echo "(^_^)\n done!!" |
This file contains 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 | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6 | |
echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list | |
sudo apt-get update | |
sudo apt-get install -y mongodb-org |
This file contains 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 | |
sudo apt-get install libxss1:i386 | |
sudo apt-get -y install libx11-6:i386 libglib2.0-0:i386 libgtk2.0-0:i386 libatk1.0-0:i386 libgdk-pixbuf2.0-0:i386 libcairo2:i386 libfreetype6:i386 libfontconfig1:i386 libxcomposite1:i386 libasound2:i386 libxdamage1:i386 libxext6:i386 libxfixes3:i386 libnss3:i386 libnspr4:i386 libgconf-2-4:i386 libexpat1:i386 libdbus-1-3:i386 | |
sudo apt-get install libudev1:i386 | |
sudo ln -sf /lib/x86_64-linux-gnu/libudev.so.1 /lib/x86_64-linux-gnu/libudev.so.0 |
This file contains 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 | |
DOCKER_MONGO_CONTAINER=$1 | |
INPUT_FILE=$2 | |
if [ $# -eq 2 ];then | |
if echo $INPUT_FILE |grep '.tar' ;then | |
docker run --rm --volumes-from $DOCKER_MONGO_CONTAINER -v $(pwd):/backup ubuntu bash -c "cd /data && tar xvf /backup/$INPUT_FILE --strip 1" | |
if [ $? -eq 0 ]; then | |
echo "volume success loaded to $DOCKER_MONGO_CONTAINER"; | |
echo "Restarting container." |
This file contains 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 | |
DOCKER_MONGO_IMAGE=$1 | |
OUT_FILE=$2 | |
if [ $# -eq 2 ];then | |
if echo $OUT_FILE |grep '.tar' ;then | |
docker run --rm --volumes-from $DOCKER_MONGO_IMAGE -v $(pwd):/backup ubuntu tar cvf /backup/$OUT_FILE /data/db | |
else | |
echo "Invalid out_file: \"$OUT_FILE\". The out file require .tar extension!" | |
fi |
This file contains 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 | |
FILE=$1 | |
if [ -f $FILE ]; | |
then | |
while read line | |
do | |
resp=`curl -s $line` | |
echo "$line $resp" |
This file contains 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 | |
ERROR_FILE="$HOME/shell/error.log" | |
COMMAND="$1" | |
PARAMS="${@:2}" | |
FULL_COMMAND="$COMMAND $PARAMS" | |