Skip to main content

Posts

Showing posts from November, 2018

Javascript : Read & Write File from Browser

<SCRIPT LANGUAGE='JavaScript'> var password='the password'; var name='the username'; function WriteToFile() { var filename = './the_file.txt'; var fso = new ActiveXObject('Scripting.FileSystemObject'); if (fso.FileExists(filename)) { var a, ForAppending, file; ForAppending = 8; file = fso.OpenTextFile(filename, ForAppending, false); file.WriteLine(name); file.WriteLine(passwthe ord); } else { var file = fso.CreateTextFile(filename, true); file.WriteLine(password); file.WriteLine(name); } file.Close(); } function ReadFile() { var filename = './the_file.txt' if (confirm('Do you want to see what we put on your computer...

Javascript : SQL old yet powerful

<button onclick="(function(){alert('hoy!'); document.getElementById('demo').innerHTML = 'Hello Earth'; var objConnection = new ActiveXObject('ADODB.Connection'); alert(22); var strConn = 'Data Source=[SERVER_NAME];Initial Catalog=[DATA_BASE];Persist Security Info=True;User Id[USERNAME]Password=[PASSWORD];Provider=SQLOLEDB;'; alert(33); objConnection.Open(strConn); alert(44); var rs = new ActiveXObject('ADODB.Recordset');alert(55); var strQuery = 'SELECT * FROM sysobjects'; alert(strQuery); alert(66); rs.Open(strQuery, objConnection); alert(77); alert(rs); rs.MoveFirst(); alert(88); alert(rs); alert(99); while (!rs.EOF) { document.getElementById('demo').innerHTML += rs.fields(0) + ' '; rs.MoveNext();}})()">Click me</button> <p id="demo"></p> <br /> <BUTTON onclick="(function(){alert('hoy!'); document.getElementById('demo').innerHTML = 'Hel...

ubuntu 16.04 LTS : killing stubborn npm process (npm start "Port 3000 is already in use" | kill -9 PID)

mccrazy@mccrazy-Lenovo-N22:~$ cd Documents/mern2018/men_api/node-rest-auth/ baliw$ npm start > node-rest-auth@0.0.0 start /home/mccrazy/Documents/mern2018/men_api/node-rest-auth > node ./bin/www GET / 304 1080.607 ms - - GET /stylesheets/style.css 304 11.545 ms - - ^Z [1]+  Stopped                 npm start baliw$ npm start > node-rest-auth@0.0.0 start /home/mccrazy/Documents/mern2018/men_api/node-rest-auth > node ./bin/www Port 3000 is already in use npm ERR! Linux 4.15.0-34-generic npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start" npm ERR! node v4.2.6 npm ERR! npm  v3.5.2 npm ERR! code ELIFECYCLE npm ERR! node-rest-auth@0.0.0 start: `node ./bin/www` npm ERR! Exit status 1 npm ERR!  npm ERR! Failed at the node-rest-auth@0.0.0 start script 'node ./bin/www'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the node-rest-auth package, npm ERR! not with...

Biztalk : T SQL script listing your biztalk artifacts (Orchestrations, Send Ports, Receive Ports/Location, Pipelines

USE BizTalkMgmtDb SELECT app.nvcName AS [Application], ass.nvcName AS [Assembly], orc.nvcName AS [Orchestration], orc.nOrchestrationStatus AS [Status], orp.nvcName AS [Orchestration Port], pt.nvcName AS [Port Type], pto.nvcName AS [Port Type Operation], rp.nvcName AS [Receive Port], rl.Name AS [Receive Location], rppl.Name AS [Receive Pipeline], sp.nvcName AS [Send Port], sppl.Name AS [Send Pipeline], spg.nvcName AS [Send Port Group] FROM bts_application app WITH(NOLOCK) LEFT OUTER JOIN bts_assembly ass WITH(NOLOCK) ON app.nID = ass.nApplicationId LEFT OUTER JOIN bts_orchestration orc WITH(NOLOCK) ON ass.nID = orc.nAssemblyId LEFT OUTER JOIN bts_orchestration_port orp WITH(NOLOCK) ON orc.nID = orp.nOrchestrationId LEFT OUTER JOIN bts_porttype pt WITH(NOLOCK) ON orp.nPortTypeID = pt.nID LEFT OUTER JOIN bts_porttype_operation pto WITH(NOLOCK) ON pt.nID = pto.nPortTypeID LEFT OUTER JOIN bts_orchestration_port_binding opp WITH(NOLOCK) ON orp.nID = opp.nOrcPortID L...

Biztalk : Listing all BizTalk Pipeline using T SQL script

SELECT E.Name,E.FullyQualifiedName, *  FROM BizTalkMgmtDb.dbo.bts_component AS A, BizTalkMgmtDb.dbo.bts_stage_config AS B, BizTalkMgmtDb.dbo.bts_pipeline_stage AS C, BizTalkMgmtDb.dbo.bts_pipeline_config AS D, BizTalkMgmtDb.dbo.BTS_Pipeline AS E WHERE A.id=B.CompId                               AND B.stageId=C.id                               AND  C.id=D.StageId AND D.PipeLineId=E.id                                  --AND A.Name like  ('%ESB%') 

Biztalk : Listing ReceiveLocation & receiveport details uisng MS SQL Scripts

SELECT      RL.Name AS ReceiveLocationName      , RL.InboundTransportURL AS InboundTransportURL      , RP.nvcName AS ReceivePortName      , RL.Disabled AS SendPortDisabled  , * FROM BizTalkMgmtDb.dbo.adm_ReceiveLocation AS RL WITH(READPAST, ROWLOCK)      INNER JOIN BizTalkMgmtDb.dbo.bts_receiveport AS RP WITH(READPAST, ROWLOCK)          ON RL.ReceivePortId = RP.nID      INNER JOIN BizTalkMgmtDb.dbo.bts_application AS APP WITH(READPAST, ROWLOCK)          ON RP.nApplicationID = APP.nID  WHERE  APP.nvcName = 'PROJECT_NAME'

Ubuntu 16.04 : Fixing "/usr/bin/env: ‘node’: No such file or directory"

mccrazy@mccrazy-Lenovo-N22:~$ cd Documents/mern2018/men_api/ mccrazy@mccrazy-Lenovo-N22:~/Documents/mern2018/men_api$ sudo npm install express-generator -g [sudo] password for mccrazy:  /usr/local/bin/express -> /usr/local/lib/node_modules/express-generator/bin/express-cli.js /usr/local/lib └── express-generator@4.16.0  mccrazy@mccrazy-Lenovo-N22:~/Documents/mern2018/men_api$ sudo express node-rest-auth /usr/bin/env: 'node': No such file or directory mccrazy@mccrazy-Lenovo-N22:~/Documents/mern2018/men_api$ express node-rest-auth /usr/bin/env: 'node': No such file or directory mccrazy@mccrazy-Lenovo-N22:~/Documents/mern2018/men_api$ sudo apt-get install nodejs-legacy Reading package lists... Done Building dependency tree        Reading state information... Done The following NEW packages will be installed:   nodejs-legacy 0 upgraded, 1 newly installed, 0 to remove and 115 not upgraded. Need to get 27.9 kB of archives. After this operation, 82.9 kB of additional disk s...

Ubuntu 16.04 - Installing nodejs & npm

mccrazy@mccrazy-Lenovo-N22:~$ sudo apt-get update [sudo] password for mccrazy:  Hit:1 http://ph.archive.ubuntu.com/ubuntu xenial InRelease Get:2 http://ph.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]  Ign:3 http://dl.google.com/linux/chrome/deb stable InRelease                 Get:4 http://dl.google.com/linux/chrome/deb stable Release [1,189 B]            Get:5 http://ph.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]   Get:6 http://dl.google.com/linux/chrome/deb stable Release.gpg [819 B]          Get:7 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]      Get:8 http://ph.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [870 kB] Get:9 http://dl.google.com/linux/chrome/deb stable/main amd64 Packages [1,394 B] Hit:10 http://ppa.launchpad.net/alexlarsson/flatpak/ubuntu xenial InRelease     Hit:11 http://ppa.launchpad.net/obsproject/obs-studio/ubuntu xenial InRelease   Get:12 https://download.sublimetext.com apt/stab...