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 / configBackup.sh
Created October 11, 2011 00:50
Configuration files manager backups and restores
#!/bin/bash
currentDate=`date +%F` # Gets current day in full formate
outputName="configBackup-$currentDate"; # Sets the output file name
tmp="/tmp"; # Sets temp folder location
randStr=`</dev/urandom tr -dc A-Za-z0-9 | head -c8`; # Stores a random string of letters and numbers of 8 characters in length
tmpFullDirName=$tmp/"configBackup-$randStr" # Sets the name of temporal folder from where the script will work
backupTargetDir=$tmpFullDirName; # Sets the temporal folder that we'll backup, this is the full previous variable
workingDir=`pwd` # Gets the folder path from where we ran the script
folderList=`ls -l | egrep '^d' | awk '{ print $9 }'`
@Termiux
Termiux / This is my monit control file
Created October 12, 2011 19:34
Monit control file
################################################################################
############################# Monit control file #############################
################################################################################
##
#
# Comments begin with a '#' and extend through the end of the line. Keywords
# are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'.
#
@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 ======================
@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 / 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`
#!/bin/bash
##################################################################
## ##
## backupCron shell script v0.2, tested on RHEL 5 ##
## Jorge A. Moreno [email protected] ##
## 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:6115547
Last active May 17, 2024 03:09
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 / 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: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 / 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 **#