Skip to content

Instantly share code, notes, and snippets.

View raulmoyareyes's full-sized avatar
💻
Programming!

Raúl Moya Reyes raulmoyareyes

💻
Programming!
View GitHub Profile
@raulmoyareyes
raulmoyareyes / checkNetwork.sh
Last active October 5, 2015 21:04
Check your internet connection.
#!/bin/bash
wget -q --tries=10 --timeout=20 --spider http://google.com
if [[ $? -eq 0 ]]; then
echo "Online"
else
echo "Offline"
fi
@raulmoyareyes
raulmoyareyes / dangerousCommands.md
Last active October 23, 2015 19:56
Linux dangerous commands.

fork bomb

:(){ :|: & };: 

Es una función bash. Una vez ejecutada, se repite varias veces hasta que el sistema se bloquea.

bit bucked

mv folder /dev/null
@raulmoyareyes
raulmoyareyes / dst.js
Last active March 2, 2018 14:32
Hora con horario de verano en Javascript
//Cambio de UTC+1 a UTC+2 en verano.
//El cambio horario se produce (a nivel Europeo) el último domingo de Marzo y de Octubre
function lastSunday(){
//días que tiene un mes
var nD = new Date(new Date().getFullYear(), new Date().getUTCMonth(), 0).getUTCDate();
var d = new Date().getUTCDay();
var n = new Date().getUTCDate();
var j = n;
@raulmoyareyes
raulmoyareyes / robot.txt
Created July 18, 2015 17:50
Robox.txt for Wordpress
#
User-agent: *
Disallow: /cgi-bin
Disallow: /wp-admin
Disallow: /wp-includes
Disallow: /wp-content/plugins/
Disallow: /wp-content/cache/
Disallow: /wp-content/themes/
Disallow: */trackback/
Disallow: */feed/
@raulmoyareyes
raulmoyareyes / sitemap.xml
Last active August 29, 2015 14:25
Sitemap example for websites
<!-- More info in http://www.sitemaps.org/es/protocol.html -->
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.raulmoya.es/</loc>
<lastmod>2013-03-27T16:26:55+00:00</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
@raulmoyareyes
raulmoyareyes / elementaryos_trash.md
Last active August 4, 2020 19:15
Create trash in elementaryOS

Launch this command in your temrminal

sudo subl /usr/share/applications/trash.desktop

Copy and paste this text in sublime text and save the file.

[Desktop Entry]
Comment=Contiene los archivos eliminados
EmptyIcon=emptytrash
# For Mac OS X El Capitan
sudo trimforce enable
# For Mac OS X Yosemite
# backup patched file
sudo cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage.original
# Important: Add "kext-dev-mode=1" as Kernel Arguments or the computer won't boot.
sudo nvram boot-args="kext-dev-mode=1"
sudo shutdown -r now