Skip to content

Instantly share code, notes, and snippets.

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

Jorge Rodriguez Flores jorgedison

🏠
Working from home
View GitHub Profile
@jorgedison
jorgedison / processdb.sql
Created September 15, 2015 22:34
View Process Database SQL Server
USE [master]
GO
-- Select a SYS.processes con bloqueo mayor a valor 0
SELECT * FROM SYS.sysprocesses WHERE blocked > 0;
-- Select a SYS.processes con login distinto a sa
SELECT * FROM SYS.sysprocesses WHERE loginame NOT IN ('sa');
-- Ubicamos el PID y ejecutamos la consulta
@Echo Off
set _fecha=%DATE:~-4%_%DATE:~3,2%_%DATE:~0,2%
Set _FTPServerName= [IP]
Set _UserName=[USER_FTP]
Set _Password=[PASSWORD]
Set _LocalFolder=[RUTA_PC_LOCAL]
Set _RemoteFolder=[RUTA_SERVER_REMOTO]
Set _Filename=[NOMBRE_ARCHIVO]_%_fecha%.7z
Set _ScriptFile=ftp1.ftp
:: Create script
@jorgedison
jorgedison / DescargaEbookIT.pl
Created January 27, 2016 15:48
Descarga Ebook IT
#!/usr/bin/env perl
#Uso:
#./it-ebooks — Descargar desde it-ebooks-info
chdir "/home/jrodriguez/" or die "Cannot change directory: $!"; #replace with your path
unless ($ARGV[0]) {
for ($sm = 1; $sm <= 10000; $sm++) { #reemplaza "10000" con el identificador de libro desde it-ebooks.info
print "Libro numero $sm descargando ahora.\n\n";
system "wget http://it-ebooks.info/book/$sm/";
$filepi = `grep -P -o "filepi.com/i/[a-zA-Z0-9]*" index.html`;
system "wget --content-disposition --referer=http://it-ebooks.info/book/$sm/ $filepi";
@jorgedison
jorgedison / Backupdbmysql.bat
Created April 11, 2016 15:12
Batch Backup Database mysql
@echo off
SET HOUR=%time:~0,2%
SET dtStamp9=%date:~-4%%date:~4,2%%date:~7,2%_0%time:~1,1%%time:~3,2%%time:~6,2%
SET dtStamp24=%date:~-4%%date:~4,2%%date:~7,2%_%time:~0,2%%time:~3,2%%time:~6,2%
if "%HOUR:~0,1%" == " " (SET dtStamp=%dtStamp9%) else (SET dtStamp=%dtStamp24%)
ECHO %dtStamp%
@jorgedison
jorgedison / OpenPort
Created May 10, 2016 19:07
Open Port Windows
netsh advfirewall firewall add rule name="Open Port 8555" dir=in action=allow protocol=TCP localport=8555
@jorgedison
jorgedison / GUIOracleLinux.sh
Created May 12, 2016 23:22
GUI Oracle Linux 6.4
yum groupinstall "X Window System" Desktop "General Purpose Desktop" \ "Graphical Administration Tools" "Legacy X Window System compatibility" \ system-config-lvm
@jorgedison
jorgedison / Nginx-Mono-OracleLinux.md
Last active July 1, 2016 21:44
Nginx - Framework Mono - Oracle Linux

Instalacion Nginx Mono-Server Oracle Linux

  • Nginx-1.1.11
  • Frameworkmono-2.10.7
  • Libgdiplus-2.10
  • xsp-2.10.2
  • pcre-8.21
  • OracleLinux-6.4

Actualización de paquetes y dependencias de Sistema operativo , aceptamos todos los paquetes y dependencias

@jorgedison
jorgedison / .gitignore
Created November 15, 2016 16:36
File gitignore
# Backup files generated by text editors #
##########################################
*.pyo
*.pyc
*.bak
*.swp
# Compiled source #
###################
*.com
yum install epel-release -y
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype- devel libxml2 libxml2- devel zlib zlib-devel glibc glibc-devel glib2 glib2- devel bzip2 bzip2-devel bison pkgconfig glib2-devel gettext make pcre-devel libX11-devel cairo cairo-devel cairomm-devel libjpeg-turbo-devel pango pango-devel pangomm pangomm-devel cmake -y
cd /tmp/
wget http://download.mono-project.com/sources/mono/mono-4.6.2.7.tar.bz2
wget http://download.mono-project.com/sources/xsp/xsp-4.2.tar.gz
wget http://download.mono-project.com/sources/mod_mono/mod_mono-3.12.tar.gz
wget http://download.mono-project.com/sources/libgdiplus/libgdiplus-4.2.tar.gz
@jorgedison
jorgedison / test.php
Created December 13, 2016 15:55
test
<?php
function getSubString($string, $length=NULL)
{
//Si no se especifica la longitud por defecto es 50
if ($length == NULL)
$length = 65;
//Primero eliminamos las etiquetas html y luego cortamos el string
$stringDisplay = substr(strip_tags($string), 0, $length);
//Si el texto es mayor que la longitud se agrega puntos suspensivos