Skip to content

Instantly share code, notes, and snippets.

View Termiux's full-sized avatar

Jorge Moreno Termiux

  • HP Enterprise Services
  • United States
View GitHub Profile
@Termiux
Termiux / gist:6889447
Last active December 25, 2015 00:39
Limit php process using cpulimit program on linux boxes
#! /bin/sh
# /etc/init.d/limitcpu
#
# Some things that run always
#
INTERVAL=30
LIMIT=75
PIDS=$(top -b -n1 -c | grep php | awk '$9>75 {print $1}')
@Termiux
Termiux / gist:6415777
Created September 2, 2013 18:25
Mongu.ru snmpd.conf
############################################################################### #
# EXAMPLE.conf:
# An example configuration file for configuring the Net-SNMP agent ('snmpd')
# See the 'snmpd.conf(5)' man page for details
#
# Some entries are deliberately commented out, and will need to be explicitly activated
#
###############################################################################
#
# AGENT BEHAVIOUR
@Termiux
Termiux / cpb.sh
Created September 2, 2013 15:55 — forked from b3niup/cpb.sh
#!/bin/bash
### Author: Benedykt 'b3niup' Przybyło
USAGE="Usage: ./$0 [options as for regular cp]"
#*****************************************************************************#
#** Helpers **#
@Termiux
Termiux / gist:6321596
Last active December 21, 2015 14:39
This sample BaseClass implements some functions to register js code to ScriptManager
public class BasePage : System.Web.UI.Page
{
/// <summary>
/// Creates an instance of a Base Page
/// </summary>
public BasePage()
{
//some init logic if you want =P
}
@Termiux
Termiux / gist:6126906
Created July 31, 2013 22:46
This is a simply example of a confirmation box and gridview using jQuery Noty plugin and Asp.Net WebForms
$(document).ready(function () {
$('#MainContent_InsertButton').click(function (e) {
// first we must stop the postback to show this confirmation
e.preventDefault();
noty({
text: 'Insert this data to system?',
buttons: [
{ addClass: 'btn btn-primary', text: 'Ok', onClick: function ($noty) {
// this = button element
@Termiux
Termiux / gist:6115547
Last active December 20, 2015 10:30
Gets the Maximum Length of a column table in Entity Framework 5
/// <summary>
/// Gets the Maximum Length of a column table in Entity Framework 5
/// Original from SO:
/// http://stackoverflow.com/questions/12378186/entity-framework-5-maxlength/12964634#12964634
/// You need to add a reference to System.Linq.Expressions
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="column"></param>
/// <returns></returns>
public static int GetColumnMaxLength<T>(Expression<Func<T, string>> column)
@Termiux
Termiux / backupCron
Created November 11, 2011 02:21
Converted to own repository https://github.com/Termiux/tarBackup
#!/bin/bash
##################################################################
## ##
## backupCron shell script v0.2, tested on RHEL 5 ##
## Jorge A. Moreno morenog.jorge@gmail.com ##
## November 2011 Backup Bash Shell Script ##
## ##
## Use script to backup your server using tar/gzip ##
## The script can copy the backup to a SMB share on ##
@Termiux
Termiux / gist:1328084
Created October 31, 2011 17:30
mailCheck
#!/bin/bash
#
# This scripts check if user has a proper .forward file
# if not present script will ask for mail and finger info
# on login given is on proper login folder
#
#Get user data
username=`whoami`
@Termiux
Termiux / gpxeScript
Created October 23, 2011 22:54
gPXE boot loader script to point to a selected boot server. Used to point to my FOG server
#!gpxe
dhcp net0
set filename pxelinux.0
set next-server fog.server.ip.address
set 210:string http://fog.server.ip.address/fogimg/
imgfetch pxelinux.0
imgload pxelinux.0
boot pxelinux.0
@Termiux
Termiux / syncFog
Created October 20, 2011 16:27
Little script that I wrote as a workaround for PXE booting a FOG server
#!/bin/bash
# ==================== IMPORTANT ======================
# This script is esential for fog functionality, if its deleted
# of modified and no longer working fog WONT be able fo start any
# kind of tasks that involve backup or restores bear in mind
# that removing or modifing this file may disable FOG system
# entirely be careful!!!!
# ==================== IMPORTANT ======================