Skip to content

Instantly share code, notes, and snippets.

@sergiohidalgo
Last active October 1, 2019 18:40
Show Gist options
  • Save sergiohidalgo/c2f61057a3b564c4c08a to your computer and use it in GitHub Desktop.
Save sergiohidalgo/c2f61057a3b564c4c08a to your computer and use it in GitHub Desktop.
Ayuda memoria

Ayuda Memoria de Sergio Hidalgo

Lstar directorios por tamaño de archivo

du -h --max-depth=1 | sort -hr

Resolver problema Docker, ubuntu bash en Windows 10:

https://serverfault.com/a/857188

SDK Android accept licences

$ANDROID_HOME/tools/bin/sdkmanager --licenses

cPanel

al crear un nuevo usuario ftp si el servidor no responde ejecutar: service iptables stop

FTP Ubuntu

apt-get install proftpd

MPSN

DED4-0A88-3A11-F9FDE

Regenerar fingerprint

ssh-keygen -R server-name
ssh-keygen -R server.ip.addre.ss
ssh-keygen -R 202.54.1.5
ssh-keygen -R server1.example.com

Genarar llave publica y privada

ssh-keygen -t rsa

Agregar a servidor

  • (opción 1)
ssh-copy-id user@123.45.56.78
  • Opción 2
cat ~/.ssh/id_rsa.pub | ssh root@desarrollo.cron.cl "mkdir -p ~/.ssh && cat >>  ~/.ssh/authorized_keys"

Comprimir archivo

tar -zcvf nombre-archivo.tar.gz nombre-directorio

Actualizar NPM a su ultima version

npm install --global npm@latest

Solucionar problema permisos Yeoman DigitalOceal ubuntu

chmod g+rwx /root /root/.config /root/.config/configstore

Accesos directos / enlaces simbolicos linux

ln [opción] [archivo o directorio de origen] [archivo o directorio destino]

Ejemplo:

ln -s /var/www/html/chile chile.cron.cl 

Virtaul Host Apache

<VirtualHost desarrollo.cron.cl>
	DocumentRoot /var/www/html
	ServerName desarrollo.cron.cl
	ServerAlias desarrollo.cron.cl
</VirtualHost>

Modificar php.ini en Ubuntu 14.04 (DO)

nano /etc/php5/apache2/php.ini
sudo /etc/init.d/apache2 restart

Re-iniciar servidor Apache

sudo service apache2 restart

Git

Ver archivos que cambiaron desde hace 7 dias con las extenciones .php .css .js .styl .json .coffee .png .jpg .jpeg

git log --since={7.days.ago} --name-only --pretty=format:'' | sort -u | grep -E '\.(php|css|js|styl|json|coffee|png|jpg|jpeg)$'

Anñadir archivos a repositorio

git remote add origin git@github.com:sergiohidalgo/aaaaa.git
git push -u origin master

Copiar un repositorio en una nueva rama

git fetch git://repository.domine/repo.git master:new_branch

copia desde el master de repo hacia new_branch del repositorio donde se ejecuto el comando.

Deshacer cambios locales

git checkout .

Redireccionar con PHP correctamente

Archivo se cambio de ubicacion permanentemente

header("HTTP/1.1 301 Moved Permanently"); 
header("Location: /option-a"); 
exit();

Acceso denegado

header("HTTP/1.1 403 Forbidden"); 
header("Location: /"); 
exit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment