Skip to content

Instantly share code, notes, and snippets.

View dapize's full-sized avatar
🏠
Working from home

Daniel P Z dapize

🏠
Working from home
View GitHub Profile
@dapize
dapize / megatools-instalador.sh
Created October 20, 2015 14:43
Es un pequeño script que instala por completo (osea, con sus dependencias) una utilidad que sirve para descargar enlaces de MEGA desde el terminal.
#!/bin/bash
# Script de instalacion de MegaToolls Por Daniel P Z - https://github.com/megous/megatools
# Ejemplo de uso: megadl 'https://mega.co.nz/#!zZJF3CiZ!zFW3ZyW4tUqIFBEQ1iE9IChv-zqoWSy2vdDMBZwDpGo'
apt-get -y install aptitude
echo "deb http://ftp.us.debian.org/debian/ unstable main contrib non-free" >> /etc/apt/sources.list
echo "deb-src http://ftp.us.debian.org/debian/ unstable main contrib non-free" >> /etc/apt/sources.list
aptitude -y update
aptitude -y install libglib2.0-dev libcurl4-openssl-dev libssl-dev
aptitude -y install megatools
clear
@dapize
dapize / Loiq-instalador.sh
Created October 20, 2015 14:50
Un simple scriptp para instalar Loiq
#!/bin/bash
# Instalar loiq
aptitude -y install libqt4-network
dpkg --add-architecture i386
aptitude -y update
aptitude -y install libqtgui4:i386
aptitude -y install ia32-libs-gtk
aptitude -y install bzip2
cd $HOME && wget http://ftp.desdelinux.net/loiq-0.3.1a.tar.bz2 && bzip2 -dc loiq-0.3.1a.tar.bz2 | tar -xv && mv loiq-0.3.1a .loiq-0.3.1a && ln -s $HOME/.loiq-0.3.1a/loiq /usr/local/bin/
echo "abrir una terminal (estando en el escritorio, ya sea XFCE, Gnome, o el que sea) y ejecutar el comando: loiq (sin los dos puntos)"
@dapize
dapize / Java-instalador.sh
Created October 20, 2015 14:53
Script para instalar Java desde terminal.
#!/bin/bash
# Script de instalacion de Java por Daniel P Z
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" >> /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" >> /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
apt-get -y install aptitude
aptitude -y update
aptitude -y install oracle-java7-installer
echo "ya esta, ya se instalo Java"
exit
@dapize
dapize / download_google_drive installer
Created January 5, 2020 05:17
Instalador de dependencias para el script download_google_drive installer: https://github.com/chentinghao/download_google_drive
#!/bin/bash
apt-get -y install aptitude
aptitude -y install build-essential checkinstall
aptitude -y install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
aptitude -y install python2.7
git clone https://github.com/chentinghao/download_google_drive.git
aptitude -y install python-pip
pip install requests
pip install tqdm
echo "listo"
# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# If this commit is applied, It will...
# <type>(<scope>): <subject>
():
# <body>
# Detalle de la incidencia (¿Qué? ¿Por qué?)
# <footer>
# Trello Card, Bitbucket Issues y/o Jira Issues que se solucionaron
@dapize
dapize / base64ToURL.js
Last active December 23, 2020 07:45
Base64 to Url
function base64ToUrl (b64Data, type = 'image/png', sliceSize = 512) {
const byteCharacters = atob(b64Data);
const byteArrays = [];
const nByteCharacters = byteCharacters.length;
for (let offset = 0; offset < nByteCharacters; offset += sliceSize) {
const slice = byteCharacters.slice(offset, offset + sliceSize);
const byteNumbers = new Array(slice.length);
for (let i = 0; i < slice.length; i++) {
byteNumbers[i] = slice.charCodeAt(i);
}
@dapize
dapize / hexToRgbA.js
Last active April 17, 2021 07:54
Hexadecimal to RGBA
function hexToRgbA(hex){
let c;
if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)){
c= hex.substring(1).split('');
if(c.length== 3){
c= [c[0], c[0], c[1], c[1], c[2], c[2]];
}
c= '0x'+c.join('');
return 'rgba('+[(c>>16)&255, (c>>8)&255, c&255].join(',')+',1)';
}
@dapize
dapize / install-nodejs-in-deepin.sh
Last active October 7, 2023 22:57
For install Node JS 14 in Deepin (distro linux)
#!/bin/sh
VERSION=node_14.x
DISTRO="$(dpkg --status tzdata|grep Provides|cut -f2 -d'-')"
echo "deb https://deb.nodesource.com/$VERSION $DISTRO main" | sudo tee /etc/apt/sources.list.d/nodesource.list
echo "deb-src https://deb.nodesource.com/$VERSION $DISTRO main" | sudo tee -a /etc/apt/sources.list.d/nodesource.list
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
sudo apt-get -y update
sudo apt-get -y install nodejs
@dapize
dapize / gist:1dde8278f66c44350e97a63b86d3e503
Created April 24, 2021 16:54
how-to-install-firefox-developer-edition-on-linux DEEPIN
We can download the application also from the command line, using the curl utility; if we combine it with tar via a pipe, we can extract the tarball "on the fly". All we have to do is to run the following command:
$ curl --location
"https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=linux64&lang=en-US" \
| tar --extract --verbose --preserve-permissions --bzip2
We invoked curl using the --location option which is needed to make curl follow redirections, and providing the download URL. If not otherwise specified, curl writes its output to stdout (standard output), so we use a pipe | to redirect said output and use it as the standard input (stdin) of the tar application.
We used the latter with some options: --extract to perform an extraction, --verbose (optional) to make the name of the extracted files be printed on the terminal when they are extracted, --preserve-permissions to preserve the files permissions, and --bzip2 to specify how the tarball should be decompressed. If everything g