Skip to content

Instantly share code, notes, and snippets.

@enriquemanuel
enriquemanuel / Apache Version
Created July 8, 2013 19:43
Get apache version from the processes running with one line of comand
# get the entire verbose
ps -ef |grep httpd| grep " 1 " |awk '{system ( $8 " -V")}'
#get the minimal verbose
ps -ef |grep httpd| grep " 1 " |awk '{system ( $8 " -v")}'
@enriquemanuel
enriquemanuel / Bb version and Apache Version
Created July 8, 2013 20:41
Get Blackboard Version and Apache version when its not in the full path
grep "bbconfig.version.number" /usr/local/blackboard/config/bb-config.properties && ps -ef | grep httpd | grep " 1 " | awk '{system ( $8 " -v")}'
@enriquemanuel
enriquemanuel / ownership_procedure.sql
Last active December 22, 2015 09:29
Change owner of folder in Blackboard database
declare
ow varchar(200);
cb varchar(200);
counter number;
message varchar(200);
begin
counter := 0;
for uu in ( select pk1, file_id , user_id, full_path, internal_principal_id
from bblearn.users uu, bblearn_cms_doc.xyf_urls, bblearn_cms_doc.XYF_PRINCIPAL_LOOKUPS pp
where FULL_PATH = '/users/'||uu.user_id and
@enriquemanuel
enriquemanuel / ssh_config_modified.sh
Created September 6, 2013 19:20
SSH configuration modified
# $OpenBSD: ssh_config,v 1.26 2010/01/11 01:39:46 dtucker Exp $
# This is the ssh client system-wide configuration file. See
# ssh_config(5) for more information. This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.
# Configuration data is parsed as follows:
# 1. command line options
# 2. user-specific file
@enriquemanuel
enriquemanuel / ssh_config_original.sh
Last active December 22, 2015 11:49
SSH original configuration
# $OpenBSD: ssh_config,v 1.26 2010/01/11 01:39:46 dtucker Exp $
# This is the ssh client system-wide configuration file. See
# ssh_config(5) for more information. This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.
# Configuration data is parsed as follows:
# 1. command line options
# 2. user-specific file
@enriquemanuel
enriquemanuel / course_content_replace.sql
Created September 9, 2013 19:36
Micro store procedure to modify or alter the course content based on title
begin
for uu in (
select pk1, title, main_data from course_contents where title like 'Title comes here%'
and
crsmain_pk1 in (select pk1 from course_main where course_id in
(<course_id>)))
loop
update course_contents
set main_data = '<p>paragraph or list or whatever you want to place here</p>'
where pk1 = uu.pk1;
@enriquemanuel
enriquemanuel / email_threaddumps.sh
Created September 24, 2013 13:30
I created this small GIST about creating 5 thread dumps one after the other waiting for 10 seconds and then gzipping them and sending them using mutt. you can install mutt using yum or your prefer method.
#! /bin/bash
#creating my folder to store them
if [ ! -d /tmp/`hostname` ]
then
mkdir -p /tmp/`hostname`
fi
#executing my command
/usr/local/blackboard/tools/admin/ServiceController.sh services.appserver.threaddump
@enriquemanuel
enriquemanuel / scrape.rb
Last active December 25, 2015 19:39
After several attempts of Web Scrapping I got to a point that I'm proud of my project, by all means this is not done and is just part of the project, This will scrape a page to get entities and match them to a server and then return that hash information. This will be used to get the images using CURB in a multi threaded application
require 'nokogiri'
class Scrape
#start function
def scrape_it(page_as_html, client_id)
#open the file
f = File.open(page_as_html)
#initialize the file for web scraping
# Normal Rsync
rsync -azP /source/folder/to/be/copied root@ip:/destination/folder/to/be/copied/to
# RSync with SSH and Passwordless
rsync -azp -e 'ssh -i /path/to/key' user@server:/remote/path/to/dir/ /local/path/to/dir/
#!/bin/sh
#custom vars
vDATE=`date +"%Y-%m-%d"`
# EXPORT BLACKBOARD BASIC CONFIGURATION
export BBHOME=`grep bbconfig.basedir= /usr/local/blackboard/config/bb-config.properties |cut -d= -f2`;
export BBCONF=$BBHOME/config/bb-config.properties;
export VINAME=`grep antargs.default.vi.db.name= $BBCONF|cut -d= -f2`;