Tuesday, January 8, 2013

SharpSSH - OpenSSH for .NET and Make-it-so sln to makefile converter




Creating cross platform build automation for compiling C++ code on MSVC (MSBuild) and g++ (GCC) was the task at hand. On the agenda was how to invoke shell commands and scripts on a Linux machine, and how to securely transfer files to and from said machine. The answer is obvious ... SSH (Secure Shell). Well, when working on Linux and UNIX machines SSH is a native tool in your toolbox, this is not so when adjusting a Microsoft Team Foundation Server 2012 to perform these tasks. To the rescue comes SharpSSH , which is a pure .NET implementation of the SSH2 client protocol suite. It provides an API for communication with SSH servers and can be integrated into any .NET application. SharpSSH allows you to read/write data and transfer files over SSH channels using an API similar to JSch's API. In addition, it provides some additional  wrapper classes which offer even simpler abstraction for SSH communication. using this easy-to use library I was able to create a TFS Build workflow code activity and design the build process template to run Bash scripts, send the source code and get the build outputs from the target Linux machine. All this sounds rather simple ... well it wouldn’t had been compete without the icing on the cake ...  Make-it-so, that converts Visual Studio solutions to Linux gcc makefiles. It needed a few tweaks to fit to the format of VS2012 sln format, but it was worth every minute. During my work I used some manual tools to run tests manually like Putty and winscp, and custom executable I wrote from SharpSSH to run manually from PowerShell.
There was only one twitch I found in this, otherwise, us full handy tool. It sets its own default environment variables (like PATH) so things don't run as smoothly as you would have expected like with native ssh. Discovering this was not without its share of trouble, things started to go "south" when I tried using complex commands like sed, grep, chmod and other native shell commands. Running the scripts manually turned a different result then via my SharpSSH client and it took me a while to try to look for the reason. In the end I, of course, found and fixed the issue.
Another useful tip when writing scripts for different platforms is that windows text editors hide special characters (like - for end of line and for backspace) and editing Bash scripts with any of those will usually case the script to fail :) (That’s why god invented  vi for). to sum things up, cross platform is as cool and fun as it is interesting and informative.
This solution may prove handy the next time you want to write g++ compatible c++ code and use the comfort of visual studio as you IDE... have the best of both worlds.
'till next time  ... be free
G.
 next ... CodeWeavers CrossOver and eclipse team explorer everywhere plug-in ,or maybe I'll conduct a comparison between remote PowerShell and SSH ... neh ... this is pointless.

Monday, January 7, 2013

Grawcho: searching for out of circulation IKEA product (TRO...

Grawcho: searching for out of circulation IKEA product (TRO...: does any one know of a way to get IKEA products that went out of circulation i bought some curtain rod's to make a  pseudo dark room dryer f...

searching for out of circulation IKEA product (TROLIG)

does any one know of a way to get IKEA products that went out of circulation i bought some curtain rod's to make a  pseudo dark room dryer for family photos.

and IKEA had stopped making them. i need a couple more (even used) to continue my project with them in an esthetically pleasing manner :)
rather then mixing, matching and \ or replacing all of them all together.
if you know of anyone that has one of them and is willing to give it up, please, let me know.
this it how it looks

G.

Monday, September 3, 2012

Help The helpers ...

Hi again.
as you may have asserted i have new found respect for Microsoft with the new Windows 8. i have some "Air Time" with it too, i installed a machine for every preview version available (developer, consumer and release previews). in anticipation for the official release, and been an MSDN subscriber, i went ahead and assumed this will profit me in the long run.
I assumed that i will be able to upgrade my edition, and keep the hours of work put in to customize my machine.

guess what ..... i was WRONG !!!

after trying everything except for installing a fresh install (on a formatted partition), i was referred to this post and followed it. At first it looked promising (may i quote from the post: "Keep in mind that this is not supported, and could end up with a catastrophic failure if some bits are not properly upgraded,")

an of course after the third re-start, i was forced to to what i didn't want to do in the first place

Re-install (at least restoring from the web is fast).

why oh why do i like to help out ?

see you soon.

G.

Friday, August 17, 2012

מדריך לבניית אתרי אינטרנט או המוסד לביטוח לאומי - שרות ונגישות מעל הכל

בעוונותיי אני נאלץ לשלם לביטוח לאומי, עד כאן הכל בסדר. יש אפילו אתר אינטרנט אשר בו אזרחי המדינה (הריעו לריבון) יכולים בנוחות ובצורה מאובטחת לשלם את מסיהם

אצתי, רצתי למחשב הקרוב למקום מגורי (פשוט שלפתי את הלפטופ מהתיק) ופתחתי את הדפדפן החביב עלי (בלי לנקוב בשמות) והפלא ופלא ... כלום, פשוט כלום

מוטב מראה עיניים
  כפי שוודאי אתם שמים לב... כך קשה במידה מסוימת לשלם מיסים, אך, לא לי
הנחתי שמדובר בבעית תאימות ולכן ניסיתי (ללא הצלחה) עוד מספר דפדפנים (שהציגו תמונה דומה) ומספר אמולטורים (מדמי תצורה) לפני שניגשתי ל"דבר האמיתי" הדפדפן האימתני של מיקרוסופט ... אינטרנט אקספלורר 10

הוא בטח יציל אותי ... הכל בנוי להתאים לו, ובטח אתרי האינטרנט של הרשויות אשר בחרו במיקרוסופט (בצדק) כספק התשתיות מס 1 שלהם ... את ההפתעה שציפתה לי ניתן להראות רק בתמונות




עכשיו ... אתם מתבוננים בתמונה ואומרים לעצמכם ... "על מה הוא מדבר?" הכל עובד ... אני אמרתי אותו דבר, ואז גיליתי שאין באתר כפי שהוא נראה שאף לא אפשרות פעולה אחת

לכן הפעלתי מחדש דפדפן אחר (פיירפוקס 14.0) וניסיתי דבר שלא היה עולה על דעתי לנסות אלמלא הוא עבד
הפעלתי תוסף*  שמפעיל את אקספלורר דרך פיירפוקס, לא לא, זה לא עוד מדמה או אמולטור זה ממש להריץ דפדפן אחד דרך ממשק משתמש של דפדפן אחר. וכפי שציינתי התוצאות היו מעבר לכל דמיון



כעת אני (וכל בני ישראל אשר מבינים "מעט" כמוני במחשבים) לשלם את חובותיי (אשר הלכו ותפחו מול עייני בזמן הנסיונות לשלמן) בנוחות וביעילות

אה... ועוד משהו קטן ... בעת הכניסה לאתר, משיקולי אבטחה, מוצגת שאלה אשר מבקשת מהאזרח להקליד את האותיות שבתמונה, לא תאמינו באיזה צירוף מקרים נתקלתי, כשראיתי את זה חשבתי שפשוט יש מישהו בביטוח הלאומי שפשוט צוחק עלי
לזה אני קורא צדק חברתי

עד הפעם הבאה

 (IETab לתוסף קוראים)*

Wednesday, June 6, 2012

Painstaking tasks (recursive archives)

Hi all ... this is another example of how to apply the "longer path" approach

isn't it annoying to unzip an archive only to find out that it contains another archive ?
here is a sipmle shell script that will help you unzip archives recursively...


I called it "rezip", it carries the same functionallity of originall "zip" command

ToDo: make it indifferent to type of archives (people tend to get clever and switch archiving methods)

'till nex time 

G.

Wednesday, May 9, 2012

Taking the longer path

As I am the "computer guy" in the family, I was appointed to be incharge of the presentation for my father-in-law 70th birthday.
Well, at least ,in charge of getting 200 picture images into a powerpoint presentation file (in deed a job worthy of my experties).

As i was starting this tedious task i looked online for an automatic solution for my problem that will save me some time, and found this nice post in msdn.

The task, of course, was a small battle of it's own (the code and my machines configuration needed some modifications due to it beeing a sample and not intended to work out of the box).
but, 3 houers (and 5 seconds of runtime) later, after showing the outcome to the "client", she said: "I would had done it faster manually".

well. I think I still like the longer path ... and I'll see what happens on his 80th (assuming I can find the code)

'till next time.

G.