Mr. Menelaos Bakopoulos is currently pursuing his PhD both at Center for TeleInFrastruktur (CTiF) at Aalborg University (AAU) in Denmark and Athens Information Technology (AIT) in Athens, Greece. He received a Master in Information Technology and Telecommunications Systems from Athens Information Technology and a B.Sc. in Computer Science & Management Information Systems from the American College of Thessaloniki. Since April 2008 he has been a member of the Multimedia, Knowledge, and Web Technologies Group.
This specific content was written 14 years ago.
Please keep this in mind as it may be outdated and not adhering to best-practices.
Introduction
In this post we analyze the following command which allows you to run “top interactively without having to look up the pids” your interested in.
top -p `pgrep process-name | tr "\\n" "," | sed 's/,$//'`
Analysis
The command is split into multiple sub commands.
top:displays running processes. With -p option means monitor specific process IDs.
pgrep: Looks through the currently running processes and lists the process IDs which matches the selection criteria (proccess-name).
pipe (|): The pipe operator. It is used to direct the stdout of the first command to the stdin of the second command.
tr (translate): Is used for replacing or removing specific characters in its input data set. Above: linefeed(\n) is replaced with comma(,) .
sed: sed is used to remove the last comma(,) for the list. Sed is a stream editor which are used to perform basic text transformations on an input stream (a file or input from a pipeline). sed‘s ability to filter text in a pipeline particularly distinguishes it from other types of editors.
This specific content was written 14 years ago.
Please keep this in mind as it may be outdated and not adhering to best-practices.
This is a quick post about creating dispatching events using javascript and specifically key press events (for use with greesemonkey or whatnot and firefox).
Note that this will not work for the latest versions of firefox in many instances. I believe this is due to security updates.
Personally I am using this dispatch keypresses to google docs from a greesemonkey script.
Below the code for typing “hello world” to google docs from a greesemonkey user script.
I suspect there may be a more efficient ways though I noticed not all browsers support the same API 🙁 . Specifically, on http://help.dottoro.com/ljbwbehw.php we see that initKeyEvent is only available in firefox. On the other hand, initTextEventis available in IE, chrome, and Safari.
This specific content was written 14 years ago.
Please keep this in mind as it may be outdated and not adhering to best-practices.
Excel VBA
Description:
This is a sample script showing how I pull web-banking balances off the internet when I want to have a total picture of how my finances are. For the boring reasoning go to the last page. Otherwise technical details follow.
Project References:
Add the following to the references for this to work:
-Microsoft HTML Object Library
-Microsoft Internet Controls
VBA references
Code:
The code below is an example of how to do this missing error handling. As it uses IE, it saves the developer the task of implementing SSL in VBA.
Navigating the Site
Public oBrowser As InternetExplorer
Sub Login_2_Website()
Dim oHTML_Element As IHTMLElement
Dim sURL As String
Dim text As String
Dim avarSplit As Variant
sURL = "https://secure.alpha.gr/e-services"
Set oBrowser = New InternetExplorer
oBrowser.Silent = True
oBrowser.navigate sURL
oBrowser.Visible = True
Do
' Wait till the Browser is loaded'
Loop Until oBrowser.readyState = READYSTATE_COMPLETE
oBrowser.document.all.Item("_contentPlaceHolder__loadedControl_NewLayoutSignOn__userName").Value = "USER"
oBrowser.document.all.Item("_contentPlaceHolder__loadedControl_NewLayoutSignOn__Pswd").Value = "PASSWORD"
oBrowser.document.all.Item("_contentPlaceHolder__loadedControl_NewLayoutSignOn__login").Click
Do
' Wait till the Browser is loaded'
Application.Wait DateAdd("s", 0.1, Now)
Debug.Print (oBrowser.document.readyState)
Debug.Print (oBrowser.LocationURL)
Loop Until oBrowser.document.readyState = "complete"
oBrowser.navigate "https://secure.alpha.gr/e-services/AWBPage.aspx?service=balancesStatements"
Do
' Wait till the Browser is loaded'
Application.Wait DateAdd("s", 2, Now)
Debug.Print (oBrowser.readyState)
Debug.Print (oBrowser.LocationURL)
Loop Until oBrowser.document.readyState = "complete"
Application.Wait DateAdd("s", 2, Now)
oBrowser.document.all.Item("_contentPlaceHolder__loadedControl_balancesStatements__productsPagedDropDownList__selectionList").selectedIndex = 1
oBrowser.document.all.Item("_contentPlaceHolder__loadedControl_balancesStatements__productsPagedDropDownList__selectedIndexHiddenField").Value = "1"
oBrowser.document.all.Item("_contentPlaceHolder__loadedControl_balancesStatements__balancesButton").Click
Do
' Wait till the Browser is loaded'
Application.Wait DateAdd("s", 0.1, Now)
Debug.Print (oBrowser.document.readyState)
Debug.Print (oBrowser.LocationURL)
Loop Until oBrowser.document.readyState = "complete"
getBalance
End Sub
This specific content was written 14 years ago.
Please keep this in mind as it may be outdated and not adhering to best-practices.
Dear All,
Quick little post about a small script I made for backing up some files from a webserver (hosting apache+mysql).
I wanted a script which would remind me to backup whenever I would log onto the specific machine.
I would have preferred automated but I’m a little paranoid about security. Why?
I don’t want to automatically compromise the security of a public webserver if another computer is hacked…so even if the backup server is hijacked no certificate/password will be stored.
Hence running the backup script required an actual user to type in the password.
This specific content was written 14 years ago.
Please keep this in mind as it may be outdated and not adhering to best-practices.
Hey, a quick post about a script I wrote for combining together multiple video files.
It’s based on a post from: http://www.webupd8.org/2009/05/join-and-split-files-including-video-in.html
Steps during execution
1) The script converts all mp4 and flv files to MPG files.
2) This is done in order to use the CAT command with > to send all the bytes from all files into one location output.mpg.
3) Finally we convert output.mpg to MP4 and have the final file.
NOTE: I will check into using possible shortcuts to speed up the process. #!/bin/bash echo echo echo Combine Videos Together echo based on http://www.webupd8.org/2009/05/join-and-split-files-including-video-in.html echo ---------------------------------------------------------- sleep 3 for i in *.mp4; do if [ -e "$i" ]; then file=`basename "$i" .mp4` echo converting "$i" to "$file.mpg" ffmpeg -i "$i" -sameq "$file.mpg" fi done
for i in *.flv; do if [ -e “$i” ]; then file=`basename “$i” .flv` echo converting “$i” to “$file.mpg” ffmpeg -i “$i” -sameq “$file.mpg” fi done
This blog is related to topics about operating systems, development, coding, and software and
contains our own opinions, code, and examples unless otherwise stated.
It is also a work in progress - so bear with us as we improve the template and content.
Aug 12 2012
Resolving “You require Permission from … to make changes to this file”
Hey,
Steps to resolve this:
1) Open up Command Prompt as Administrator.
2) Enter in command prompt:
for files: takeown /f filefor directories: takeown /f directory /r
3) Assign your username full rights:
cacls file /G username:FBy Menelaos Bakopoulos • windows 7 0