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
# To install tsql: sudo apt install freetds-bin | |
TDSVER=8.0 tsql -H $host -p $port -D $database -U $user -P |
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 -e | |
# netsuiteTokenPassportGenerator.sh | |
# @author: Nestor Urquiza | |
# @date: 20121221 | |
account=****** | |
consumerKey=******** | |
token=********* | |
nonce=`cat /dev/urandom | env LC_CTYPE=C tr -dc 'a-zA-Z0-9' | fold -w 20 | head -n 1` | |
timestamp=`date +%s` |
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
# Installation | |
* See the restore instructions if you need to restore from backups | |
* Make sure /srv/gitlab/ is completely removed in the host | |
* Use the below ~/docker-compose.yml file. The gitlab root user takes effect *only* for brand new installations | |
``` | |
gitlab: | |
image: 'gitlab/gitlab-ce:8.7.0-ce.0' | |
restart: always | |
hostname: 'gitlab.sample.com' | |
container_name: 'gitlab' |
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
#!/usr/bin/awk | |
# spring-impersonation-audit.awk | |
# author: Nestor Urquiza | |
# date: 20151123 | |
# description: Lists users and impersonated users per request | |
{ | |
if(!usernames[$8] && match($0,"login.*j_username")){ | |
usernames[$8]=gensub(/^.*j_username=([^& ]*)[& ].*$/,"\\1","g"); | |
} |
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
# Let us consider the following typical mysql backup script: | |
mysqldump --routines --no-data -h $mysqlHost -P $mysqlPort -u $mysqlUser -p$mysqlPassword $database | |
# It succeeds but stderr will get: | |
# Warning: Using a password on the command line interface can be insecure. | |
# You can fix this with the below hack: | |
credentialsFile=/mysql-credentials.cnf | |
echo "[client]" > $credentialsFile | |
echo "user=$mysqlUser" >> $credentialsFile | |
echo "password=$mysqlPassword" >> $credentialsFile |
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 -e | |
# | |
# ubuntu-install-xrdp.sh | |
# Tested in Ubuntu 20.04: Bidirectional clipboard does work. | |
# | |
# One line installer (change ubuntu by the username that you want to remotely login): | |
# curl -L https://gist.github.com/nestoru/fee24a59804d60ccba1a/raw | sudo bash -s ubuntu | |
# | |
START=$(date +%s) |
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/uname -X | grep NumCPU | ggrep -o '[0-9]*' |
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
# install redis | |
cd /tmp | |
rm -fr redis-stable | |
wget http://download.redis.io/redis-stable.tar.gz | |
tar xvzf redis-stable.tar.gz | |
cd redis-stable | |
make | |
make install | |
# prepare necessary directories |
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
# for some reason npm does not get installed until removing and reinstalling node | |
add-apt-repository -y ppa:chris-lea/node.js \ | |
&& apt-get update \ | |
&& apt-get install -y nodejs=$version* \ | |
&& apt-get remove -y nodejs \ | |
&& apt-get install -y nodejs |
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
Dockerfile.partial | |
================== | |
# Omitting apache related configuration | |
RUN apt-get -y update | |
RUN apt-get -y install imagemagick | |
RUN mkdir -p /var/www/wiki | |
RUN cd /var/www \ |