Integrar Netbeans 7 y CodeIgniter

Hola, a continuación os resumo los pasos a seguir para integrar Netbeans con Codeginiter y así dispongamos del auto-completado de Netbeans:

1.- Dentro del proyecto de Netbeans, creamos un nuevo directorio dentro de la carpeta nbproject, a la cual le podemos poner el nombre que queramos, por ejemplo “ci_autocompletado”.

2.- Creamos un nuevo archivo dentro de la carpeta anterior, también con el nombre que queramos, por ejemplo “ci_autocompletado.php”.

3.- Copiamos dentro del archivo el siguiente código:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
* @property CI_DB_active_record $db
* @property CI_DB_forge $dbforge
* @property CI_Benchmark $benchmark
* @property CI_Calendar $calendar
* @property CI_Cart $cart
* @property CI_Config $config
* @property CI_Controller $controller
* @property CI_Email $email
* @property CI_Encrypt $encrypt
* @property CI_Exceptions $exceptions
* @property CI_Form_validation $form_validation
* @property CI_Ftp $ftp
* @property CI_Hooks $hooks
* @property CI_Image_lib $image_lib
* @property CI_Input $input
* @property CI_Language $language
* @property CI_Loader $load
* @property CI_Log $log
* @property CI_Model $model
* @property CI_Output $output
* @property CI_Pagination $pagination
* @property CI_Parser $parser
* @property CI_Profiler $profiler
* @property CI_Router $router
* @property CI_Session $session
* @property CI_Sha1 $sha1
* @property CI_Table $table
* @property CI_Trackback $trackback
* @property CI_Typography $typography
* @property CI_Unit_test $unit_test
* @property CI_Upload $upload
* @property CI_URI $uri
* @property CI_User_agent $user_agent
* @property CI_Validation $validation
* @property CI_Xmlrpc $xmlrpc
* @property CI_Xmlrpcs $xmlrpcs
* @property CI_Zip $zip
*/
class CI_Controller {};
 
/**
* @property CI_DB_active_record $db
* @property CI_DB_forge $dbforge
* @property CI_Config $config
* @property CI_Loader $load
* @property CI_Session $session
*/
 
class CI_Model {};
 
?>

4.- Guardamos y nos vamos a las propiedades de nuestro proyecto: propiedades / PHP Include Path y ahí elegimos el siguiente Path, para seguir los ejemplos sería: “nbproject/ci_autocompletado”

5.- Reiniciamos y listo!

WordPress Permalinks, cambiar la estructura de los Enlaces Permanentes

WordPress Permalinks, cambiar la estructura de los Enlaces Permanentes,

WordPress Permalink

Enlaces permanentes en WordPress

Ajustes / Enlaces Permanentes

Se trata de las URLs individuales de cada entrada del blog, la dirección hacia determinado artículo del blog. A los buscadores webs les suele gustar la estructura “humanizada” de los enlaces tipo: “www.garberinformatica.com/linux/articulo-nuevo-linux” por lo que cambiar el tipo de estructura de nuestros enlaces permanentes en WordPress será una de las primeras tareas que debemos hacer.

Sigue leyendo

Superordenador de Amazon

Amazon ha entrado en el club de los superordenadores aunque, si queremos ir a ver su máquina, probablemente nos llevemos un chasco porque no existe. No existe al menos en el mundo real. El superordenador de Amazon es un nuevo ejemplo de lo que puede dar de sí la computación distribuida.

El proyecto, en realidad, nació como beta allá por 2005, se llama Amazon Elastic Compute Cloud o EC2 y forma parte de la lista de servicios web del gigante de internet. la red EC2 alquila su potencia a quien la necesite para todo tipo de tareas distribuidas sólo que, a estas alturas, su potencia ya se eleva hasta los 240 teraflops gracias a sus 30.000 núcleos funcionando en distintos lugares del mundo.

Sigue leyendo

.conkyrc

Os dejo mi archivo conky, por si a alguien le pueda servir.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
background yes
font Snap.se:size=16
xftfont Snap.se:size=12
use_xft yes
xftalpha 0.1
update_interval 1.0
total_run_times 0
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
minimum_size 206 5
maximum_width 206
default_color 231f20
default_shade_color 000000
default_outline_color 000000
alignment top_right
gap_x 30
gap_y 30
no_buffers yes
cpu_avg_samples 2
override_utf8_locale yes
uppercase no # set to yes if you want all text to be in uppercase
use_spacer no
 
TEXT
${font LcdD:style=bold:pixelsize=30}${alignc}${time %H:%M:%S}${font Snap.se:size=8}
${font Sans Serif:pixelsize=12}${alignc}${time %A, %d del %m / %Y}${font Snap.se:size=8}
 
${font Aerial:style=bold:pixelsize=12}SYSTEM${font Snap.se:size=8} ${hr 1 }
 
Hostname: $alignr$nodename
Kernel: $alignr$kernel
Uptime: $alignr$uptime
Processes: ${alignr}$processes ($running_processes running)
Load: ${alignr}$loadavg
 
CPU 1      ${alignc} ${freq}MHz / ${acpitemp}C ${alignr}(${cpu cpu1}%)
${cpubar 4 cpu2}
${cpugraph cccccc ffffff}
 
CPU 2      ${alignc} ${freq}MHz / ${acpitemp}C ${alignr}(${cpu cpu2}%)
${cpubar 4 cpu2}
${cpugraph cccccc ffffff}
 
RAM ${alignr}$mem / $memmax ($memperc%)
${membar 4}
 
SWAP ${alignr}$swap / $swapmax ($swapperc%)
${swapbar 4}
 
Highest CPU $alignr CPU% MEM%
${hr 1}
${top name 1}$alignr${top cpu 1}${top mem 1}
${top name 2}$alignr${top cpu 2}${top mem 2}
${top name 3}$alignr${top cpu 3}${top mem 3}
 
Highest MEM $alignr CPU% MEM%
${hr 1}
${top_mem name 1}$alignr${top_mem cpu 1}${top_mem mem 1}
${top_mem name 2}$alignr${top_mem cpu 2}${top_mem mem 2}
${top_mem name 3}$alignr${top_mem cpu 3}${top_mem mem 3}
 
${font Aerial:style=Bold:pixelsize=12}FILESYSTEM ${font Snap.se:size=8}${hr 1}
 
Root: ${alignr}${fs_free /} / ${fs_size /}
${fs_bar 4 /}
 
Home: ${alignr}${fs_free /home} / ${fs_size /home}
${fs_bar 4 /home}
 
Windows: ${alignr}${fs_free /windows} / ${fs_size /windows}
${fs_bar 4 /windows}
 
${font Aerial:style=Bold:pixelsize=12}NETWORK ${font} ${font Snap.se:size=8}${hr 1}
${font Aerial:syle:bold:size=8}${alignr}${execi 3600 curl www.whatismyip.org}${font}
 
${font Aerial:syle:bold:size=8}Down ${downspeed eth0} k/s ${alignr}Up ${upspeed eth0} k/s
${downspeedgraph eth0 25,107 cccccc ffffff} ${alignr}${upspeedgraph eth0 25,107 cccccc ffffff}
Total ${totaldown eth0} ${alignr}Total ${totalup eth0}

Paginador para OpenCMS

Un sencillo paginador para OpenCMS:

?Descargar paginador.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<%@ page pageEncoding="UTF-8" %>
<%@ page session="true" import="org.opencms.util.*, java.util.*" %>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page import="org.opencms.jsp.*" %>
 
<%
pageContext.setAttribute("patronRecursos", "news_%(number).html"); 
pageContext.setAttribute("tipoRecursos", "news"); 
pageContext.setAttribute("numeroElementosTotales", "100"); 
CmsJspActionElement cms = new CmsJspActionElement(pageContext,request,response);
pageContext.setAttribute("rutaDirectorio", cms.getRequest().getParameter( "directorio" )); 
 
%>	
 
<cms:contentload collector="allInFolderDateReleasedDesc" param="%(pageContext.rutaDirectorio)%(pageContext.patronRecursos)|%(pageContext.tipoRecursos)" pageSize="3" pageIndex="%(param.pag)" pageNavLength="1" editable="true">
<cms:contentinfo var="info" scope="page" /> 
 
<c:choose>	
<c:when test="${info.resultSize > 0}">
<c:if test="${(info.resultIndex % 2 == 1)}"></c:if>	
<c:if test="${(info.resultIndex % 2 != 1)}"></c:if> 
 
<c:set var="firstimage" value="" />
<c:set var="nextimages" value="" />
 
<cms:contentcheck ifexists="Image">
	<c:set var="count" value="1" />
		<cms:contentloop element="Image">
		      <c:if test="${count == 1}">
				<c:set var="firstimage"><img src="<cms:link><cms:contentshow element="Image" /></cms:link>" border="0" alt="<cms:contentshow element="Description" />" title="<cms:contentshow element="Description" />" align="right" hspace="5"></c:set>
				<img src="<cms:link><cms:contentshow element="Image"/> </cms:link>" width="130px"/>
			</c:if>
				<c:if test="${count > 1}">
					<c:set var="nextimages"><c:out value="${nextimages}" escapeXml="false" /><p><img src="<cms:link><cms:contentshow element="Image" /></cms:link>" border="0" alt="<cms:contentshow element="Description" />" title="<cms:contentshow element="Description" />"><br clear="all"><small><cms:contentshow element="Description" /></small></p></c:set>
				</c:if>
				<c:set var="count" value="${count + 1}" />
			</cms:contentloop>
		</cms:contentcheck>
 
                        <c:set var="dateString">
				<cms:contentshow element="Date"/>
			</c:set>
			<%
				java.util.Date date = new java.util.Date();
				try{
					date.setTime(Long.parseLong(pageContext.getAttribute("dateString").toString()));
					pageContext.setAttribute("date", date);
				}catch(Exception e){
					pageContext.setAttribute("date", "");
				}
			%>
 
			<fmt:formatDate value="${date}" type="date" pattern="dd/MM/yyyy"/>
 
			<cms:contentshow element="Title" />
 
		<cms:contentcheck ifexists="Teaser" >
	               	<cms:contentshow element="Teaser" />
	        </cms:contentcheck>
 
      			<img src="<cms:link>../resources/img/icon_leer_mas.png</cms:link>" width="17" height="17" /> <a href="<cms:link><cms:contentshow element="%(opencms.filename)" /></cms:link>">Leer más</a>&nbsp;&nbsp;
 
        		<cms:contentloop element="Attachment">
 
				<c:set var="tipoArchivo">
					<cms:contentshow element="File" />
				</c:set>
 
				<c:if test="${fn:endsWith(tipoArchivo, '.pdf') || fn:endsWith(tipoArchivo, '.PDF')}">
					<img src="<cms:link>../resources/img/icon_pdf.png</cms:link>" width="17" height="17" />&nbsp;<a href="<cms:link><cms:contentshow element="File" /></cms:link>"><cms:contentshow element="Description" />Descargar PDF</a>&nbsp; 
				</c:if>
 
				<c:if test="${fn:endsWith(tipoArchivo, '.jpg') || fn:endsWith(tipoArchivo, '.JPG')}">
					<img src="<cms:link>../resources/img/icon_img.png</cms:link>" width="17" height="17" />&nbsp;<a href="<cms:link><cms:contentshow element="File" /></cms:link>"><cms:contentshow element="Description" />Imágenes</a>&nbsp; 
				</c:if>
 
				<c:if test="${fn:endsWith(tipoArchivo, '.mp4') || fn:endsWith(tipoArchivo, '.MP4')}">
					<img src="<cms:link>../resources/img/icon_video.png</cms:link>" width="17" height="17" />&nbsp;<a href="<cms:link><cms:contentshow element="File" /></cms:link>"><cms:contentshow element="Description" />Vídeo</a>&nbsp; 
				</c:if>
 
				<c:if test="${fn:endsWith(tipoArchivo, '.mp3') || fn:endsWith(tipoArchivo, '.mp3')}">
					<img src="<cms:link>../resources/img/icon_video.png</cms:link>" width="17" height="17" />&nbsp;<a href="<cms:link><cms:contentshow element="File" /></cms:link>"><cms:contentshow element="Description" />Audio</a>&nbsp; 
				</c:if>
 
			</cms:contentloop>
 
</c:when> 
<c:otherwise>	
No hay ningun contenido en esta categoria, seleccione otra distinta.
</c:otherwise> 
</c:choose>	
</cms:contentload>
<c:if test="${info.pageIndex == 1}">
<c:choose>
<c:when test="${info.pageIndex == 1}">
</c:when>
<c:otherwise>
 
<a href="<cms:link><cms:info property="opencms.request.uri"/><c:out value="?pag=${1}"/></cms:link>"> <img src="<cms:link>../resources/img/dobleflecha_izquierda.png</cms:link>" width="13" height="10" border="0"/> </a>
<a href="<cms:link><cms:info property="opencms.request.uri"/><c:out value="?pag=${info.pageIndex-1}"/></cms:link>"> <img src="<cms:link>../resources/img/flecha_izquierda.png</cms:link>" width="7" height="10" border="0"/> </a>
 
</c:otherwise>
</c:choose>
</c:if>
 
<c:if test="${info.pageIndex>1}">
 
<a href="<cms:link><cms:info property="opencms.request.uri"/><c:out value="?pag=${1}"/></cms:link>"> <img src="<cms:link>../resources/img/dobleflecha_izquierda.png</cms:link>" width="13" height="10" border="0"/> </a>
<a href="<cms:link><cms:info property="opencms.request.uri"/><c:out value="?pag=${info.pageIndex-1}"/></cms:link>"> <img src="<cms:link>../resources/img/flecha_izquierda.png</cms:link>" width="7" height="10" border="0"/> </a>
 
</c:if>
<c:if test="${info.pageIndex==1}">
</c:if>
<c:forEach var="i" begin="1" end="${info.pageCount}">
<a href="<cms:link><%=cms.getRequestContext().getUri() %>?pag=<c:out value="${i}" /></cms:link>" class="paginacionActiva"><c:out value="${i}"/></a>
</c:forEach>	
 
<c:if test="${info.pageIndex < info.pageCount}">
<a href="<cms:link><cms:info property="opencms.request.uri"/><c:out value="?pag=${info.pageIndex+1}"/></cms:link>"> <img src="<cms:link>../resources/img/flecha_derecha.png</cms:link>" width="7" height="10" border="0"/> </a>
<a href="<cms:link><cms:info property="opencms.request.uri"/><c:out value="?pag=${info.pageCount}"/></cms:link>"> <img src="<cms:link>../resources/img/dobleflecha_derecha.png</cms:link>" width="13" height="10" border="0"/> </a>
 
</c:if>
 
 
<c:if test="${info.pageIndex == info.pageCount}">
<c:choose>
<c:when test="${info.pageIndex == info.pageCount}">
</c:when>
<c:otherwise>
</c:otherwise>
</c:choose>
</c:if>