Quick coffee tip - out cream and/or sugar in your cup BEFORE pouring the coffee & you won't need a spoon!
Sent from my Verizon Wireless BlackBerry
Sent from my Verizon Wireless BlackBerry
Mobile post sent by bandit36 using Utterli.
SSH server w/ music + sshfs = streaming media server!I've only used this from my laptop at work where I have .amazing. bandwidth, but I didn't notice any lagging, skipping or other connection related problems with actually playing music or video.
It's rediculously easy with a Ubuntu laptop:
- Install an SSH server on your home computer.
- Install sshfs on your laptop:
sudo apt-get install sshfs- "Graft" your home computer's file system into your laptop's:
sshfs username@home.computer.dns:/cygdrive /home/yourusername/sshfs
The result of this project will make it possible for your users to get quick glances at the details of an event displayed on a SharePoint calendar without having to click the link and look at the page. To do it the way I did, you'll need SharePoint Designer so you can make the pop-up page. Not having SPD doesn't stop you, but it will mean that your event detail pop-ups will look strange.Step 1 - Create the Calendar
=CONCATENATE("<tag> <nobr style='font-weight:lighter;'><span onMouseOver=if(event.shiftKey){popUp('xxx')}>",[Title],"</span></nobr>")Step 2 - Create the Pop-up Display
<script type="text/javascript">
var theTRs = document.getElementsByTagName("TR");
var r=0;
while (r < theTRs.length)
{ try
{ strLabel = theTRs[r].innerText || theTRs[r].textContent;
strLabel = strLabel.replace(/\t/g,"").replace(/\n/g,"");
if (strLabel.search("cc") == 0 || strLabel.search("Workspace") == 0)
{ theTRs[r].style.display = "none"; }
}
catch(err){}
r+=1;
}
var theButtons = document.getElementsByTagName("INPUT");
var b=0;
while (b < theButtons.length)
{ try
{ if (theButtons[b].value == "Close")
{ theButtons[b].style.display = "none"; }
}
catch(err){}
b+=1;
}
</script>
Step 3 - Customize Calendar.aspx
<div id='popUpDiv' style='display:none;position:absolute;'>
<div
onClick='hidePopUp()'
style='border-style:solid;
border-width:1px;
background:red;
position:absolute;
top:0px;
left:456px;
cursor:pointer;'>
close(x)
</div>
<iframe
id='popUpFrame'
frameborder='0'
src=''
style='width:520px;
height:600px;
border-style:solid;
border-width:1px'>
</iframe>
</div>
<script type="text/javascript">
var theTags = document.getElementsByTagName("A");
var i=0;
while (i < theTags.length)
{ try
{ TagContent = theTags[i].innerText || theTags[i].textContent;
if (TagContent.search("<tag>") >= 0)
{ strId = theTags[i].href.substr(theTags[i].href.search("ID=")+3);
theTags[i].innerHTML = TagContent.replace(/xxx/g,strId);
}
}
catch(err){}
i=i+1;
}
function popUp(x)
{
var popUpFrame = document.getElementById("popUpFrame");
var popUpDiv = document.getElementById("popUpDiv");
popUpFrame.src = "http://path.to/popupDisplay.aspx?ID=" + x;
popUpDiv.style.display = "";
popUpDiv.style.top = "25%";
popUpDiv.style.left = ((screen.width - 520)/2);
}
function hidePopUp()
{ popUpFrame.src = ""; popUpDiv.style.display = "none"; }</script>
Thanks in large part to help from George Rhee, I was able to isolate a bug in the code that prevented it from working properly on certain sites. The problem came about if the Maps Link column was the last column on the list and manifest itself by demolishing the columns and formatting of the list. I found a way to prevent this and now it will work regardless of where the column is in relation to other columns in the list.
I've also updated the code so that the maps popup will show up within the body of the page you're viewing. No more having to scroll right and/or down to see your maps!
Here's how:=CONCATENATE("<div style='cursor:hand' onClick='showMap(this, event)'>",Address,"</div><tag>")<div id='mapDiv' style='display:none;position:absolute;'>
<div
onClick='hideMap()'
style='border-style:solid;
border-width:1px;
background:red;
position:absolute;
top:0px;
left:554px;
cursor:hand;'>
close(x)
</div>
<iframe
id='mapFrame'
frameborder='0'
src=''
style='width:600px;
height:600px;
border-style:solid;
border-width:1px'>
</iframe>
</div>
<script type="text/javascript">
//
// declare variables
var theTags = document.getElementsByTagName("TD");
var i=0;
var objFrame = document.getElementById("mapFrame");
var objDiv = document.getElementById("mapDiv");
var out = document.getElementById("output");
//
// write the calculated column into the page code
while (i < theTags.length)
{ try
{ TagContent = theTags[i].textContent || theTags[i].innerText;
if (TagContent.substr(TagContent.search("<tag>")) == "<tag>" && theTags[i].className == "ms-vb2")
{ theTags[i].innerHTML = TagContent; }
}
catch(err){}
i=i+1;
}
//
// function to make the map appear at the mouse
function showMap(obj, event)
{
urlMaps = "http://maps.google.com/maps?q=";
objFrame.src = urlMaps + (obj.innerText || obj.textContent);
objDiv.style.display = "";
(event.clientY + 600 > document.body.offsetHeight) ? objDiv.style.top = (document.body.offsetHeight - (event.clientY - 600)) : objDiv.style.top = event.clientY;
(event.clientX + 600 > document.body.offsetWidth) ? objDiv.style.left = (event.clientX - 600) : objDiv.style.left = event.clientX;
}
//
// function to hide the map
function hideMap()
{ objFrame.src = ""; objDiv.style.display = "none"; }
</script>
So this morning, in my desperation, I turned on "Show All Characters" in Notepad++ (my text editor of choice). BINGO! The difference between my code and the code that I copy/pasted is that I had carriage returns and line feeds in my code and there were only line feeds in the code that worked. I was able to correct this by telling Notepad++ to format the text in "Unix Format". After doing this and running the script, my arrays were full of the lines in the text file.
<script type="text/javascript">
var aryV = location.search.replace("?","").split("&");
var i=0
while (i < aryV.length)
{ if (aryV[i].indexOf("s=") >= 0)
{ strState = aryV[i].substr(aryV[i].indexOf("=")+1).replace(/%20/g, " ");
strState = strState.replace(/\+/g, " ");
}
else if (aryV[i].indexOf("id=") >= 0)
{ strID = aryV[i].substr(aryV[i].indexOf("=")+1).replace(/%20/g, " ");
strID = strID.replace(/\+/g, " ");
}
else if (aryV[i].indexOf("person=") >= 0)
{ strPerson = aryV[i].substr(aryV[i].indexOf("=")+1).replace(/%20/g, " ");
strPerson = strPerson.replace(/\+/g, " ");
}
i+=1;
}
document.write("<tt>The State is : " + strState + "<br>");
document.write("The ID is : " + strID + "<br>");
document.write("The Person is: " + strPerson + "</tt>");
</script>
The Challenge: We need to update the firmware of some of our Cisco network devices.You can download the scripts in a .zip file here.
The Problem: We have MANY of these devices and no current inventory of which devices have what firmware installed (that I know of anyway). So I needed to generate the list of devices that need the update. The simple way is to log into the devices, run a "show version" command and record the firmware version for the device. Repeat that process a couple hundred times and you can see why this is a problem.
The Solution: BASH scripting on Ubuntu Linux. After doing a bit of research & studying other people's scripts to access devices, I managed to pull together a couple scripts to automate the process of logging into a device, running a command, and logging/processing the output. Here's how:Step 1 - Acquire a list of the devices you want to scan. Put them in the "hosts.txt" file, one per line. You can list them by DNS or IP address.
Step 2 - Put the commands you want to run on the hosts into the "cmds.txt" file. One per line just like you were executing them yourself.
Step 3 - From your Linux box (I used Ubuntu on my EeePC) run the "./ciscoScanner.sh" script like this:./ciscoScanner.sh USERNAME PASSWORD text|to|findStep 4 - Monitor the progress in the terminal window.
Step 5 - When the script is done you'll have a file named "[date].scan.log" with only the lines from the fields you put in "text|to|find". You can then parse this in Excel or any other method that's convenient for you.