Skip to main content

Posts

Showing posts from 2018

Windows 10 - How to Enable Linux

Enabling Windows 10 Developer MODE - Start - Type > For developers Settings - Use developer features > Developer mode Enabling Windows 10 Linux subsystem - Start - Type > Control Panel - Programs  - Programs and Features - Turn Windows features on or off - Windows Subsystem for linux (Beta) Installing the rest - Start - cmd - bash - follow alone the instructions

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...

PowerShell : Moodleroom API update idnumber field

# 24.Oct.2018 09:50AM  # To Run => powershell -ExecutionPolicy Bypass -File "C:\BizTalk_Zone\PowerShellScripts\Learn_idnumber_update.ps1" $theDomain = " https://learn.sm.ph " $theToken = "0f90b7ad55ed7d123bcf173ded79b843" # $theDomain = " https://sm-sandbox.ph " # $theToken = "18c0b4b7as2caeaca23bfww9aoc7ee40" $generic_headers = @{ Authorization = $generic_BasicAuthValue } function getUrl() {     return  $theDomain + "/webservice/rest/server.php?wstoken=" + $theToken } function updateIdNumber($id, $idNumber)  {     $urlBase = getUrl      $uri = $urlBase + "&wsfunction=core_user_update_users&moodlewsrestformat=xml&users[0][id]=$id&users[0][idnumber]=$idNumber"     $uri     return  Invoke-RestMethod -Method 'Post' -Uri $uri } function getDetails($key, $value)  {     $urlBase = getUrl      $uri = $urlBase + "&wsfunction=core_user_get_users&moodlewsrestformat=xml&criteria[0][ke...

Progressive Web Apps : Enabling PWA on Chrome

url => chrome://flags/

SUBLIME Text : Insert Date/Time Stamp on F5

FIRST, install the package manager (tools install package manager) then in Preferences - Browse Packages - User (folder), make a file called whatever.py and paste the following 6 lines into it: import sublime, sublime_plugin, time class InsertDatetimeCommand(sublime_plugin.TextCommand): def run(self, edit): sel = self.view.sel(); for s in sel: self.view.replace(edit, s, time.strftime( '%Y.%m.%d %H:%Y' )) NOW in preferences - keybindings - User, add this line: { "keys": ["f5"], "command": "insert_datetime"} Now in sublime text you can hit F5 to autoinsert the date and time just like notepad on Windows.

Google Suites - Update Google Sheet Column with Fusion Table Column Using Google App Scripts

function GETLatestValue() {   var sheet = SpreadsheetApp.getActiveSheet();   var data = sheet.getDataRange().getValues();   for (var i = 1; i < data.length; i++) {     Logger.log('PN: ' + data[i][0]);     //Logger.log('Product number: ' + data[i][1]);     var sql = 'SELECT * FROM 1Ynn6Jt34YaPV7ojdJNrp9sXoHTqLWRCIBaOKbpCZ WHERE PN_ID = ' + data[i][0] + ' LIMIT 1';     Logger.log(sql);     var result = FusionTables.Query.sqlGet(sql, {       hdrs: false     });     Logger.log(result.rows);     if (result.rows) {       //data(i,1).setValue(evento[i]);       Logger.log('rows[0][2]: %s', result.rows[0][2]);       Logger.log('rows[0][3]: %s', result.rows[0][3]);       //data[i][1] result.rows[0][2];      sheet.getRange(i+1,2).setValue(result.rows[0][2]);      sheet.getRange(i+1,3).setValue(result.rows[0][3]);     }   }        /*   var sql = 'SELECT * FROM 1Ynn6Jt34YaPV7ojdJNrp9sXoHTqLWRCIBaOKbpCZ WHERE LIMIT 1000';   Logger.log(sql); ...

Alidropship plugins - Da Vince Theme Subscription Fixed using MailChimp

From MailChimp Code: Wrecked the design on the UI <!-- Begin MailChimp Signup Form --> <link href="// cdn-images.mailchimp.com/embedcode/slim-10_7.css " rel="stylesheet" type="text/css"> <style type="text/css"> #mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif;  width:450px;} /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.    We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */ </style> <div id="mc_embed_signup"> <form action=" https://tester.us19.list-manage.com/subscribe/post?u=5b6e4f12343b19be8f09a2fef&amp;id=aeeef4383c " method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>     <div id="mc_embed_signup_scroll"> <label for...

Ubuntu 16.04 LTS - SDL2 Installation for Shotcut

#install sdl2 sudo apt install libsdl2-dev libsdl2-2.0-0 -y; #install sdl image sudo apt install libjpeg9-dev libwebp-dev libtiff5-dev libsdl2-image-dev libsdl2-image-2.0-0 -y; #install sdl mixer sudo apt install libmikmod-dev libfishsound1-dev libsmpeg-dev liboggz2-dev libflac-dev libfluidsynth-dev libsdl2-mixer-dev libsdl2-mixer-2.0-0 -y; #install sdl true type fonts sudo apt install libfreetype6-dev libsdl2-ttf-dev libsdl2-ttf-2.0-0 -y;

Ubuntu : Installing Shotcut thru snap

mccrazy@mccrazy-Lenovo-N22:~$ sudo apt-get install snapd snapd-xdg-open [sudo] password for mccrazy:  Reading package lists... Done Building dependency tree        Reading state information... Done The following packages were automatically installed and are no longer required:   linux-headers-4.13.0-36 linux-headers-4.13.0-36-generic   linux-image-4.13.0-36-generic linux-image-extra-4.13.0-36-generic   linux-signed-image-4.13.0-36-generic linux-signed-image-generic-hwe-16.04 Use 'sudo apt autoremove' to remove them. The following additional packages will be installed:   ubuntu-core-launcher The following NEW packages will be installed:   snapd-xdg-open The following packages will be upgraded:   snapd ubuntu-core-launcher 2 upgraded, 1 newly installed, 0 to remove and 89 not upgraded. Need to get 14.2 MB of archives. After this operation, 279 kB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://ph.archive.ubuntu.com/ubuntu xenial-updates/main ...

c# : converting full word month to datetime

            DateTime dateNow = DateTime.Now;             string excelMonth = "July";             int lessNumberOfMonth = dateNow.ToString("MMMM").ToLower().Equals(excelMonth.ToLower()) ? 0 : 1;             Console.WriteLine(lessNumberOfMonth);             string dateString = string.Format("{0} 1, {1}", "june", dateNow.AddMonths(-lessNumberOfMonth).Year);             DateTime dt = DateTime.ParseExact(dateString, "MMMM d, yyyy", new CultureInfo("en-US"));             Console.WriteLine(dt);

Ubuntu 16.04 - Installing Ruby 2.2.10 & 2.5.1 thru RVM

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]    Get:3 http://ph.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]  Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]     Get:5 http://ph.archive.ubuntu.com/ubuntu xenial-updates/main amd64 DEP-11 Metadata [318 kB] Hit:6 http://ppa.launchpad.net/alexlarsson/flatpak/ubuntu xenial InRelease     Get:7 http://ph.archive.ubuntu.com/ubuntu xenial-updates/main DEP-11 64x64 Icons [228 kB] Hit:8 http://ppa.launchpad.net/obsproject/obs-studio/ubuntu xenial InRelease   Hit:9 https://download.sublimetext.com apt/stable/ InRelease                   Get:10 http://ph.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 DEP-11 Metadata [246 kB] Get:11 http://security.ubuntu.com/ubuntu xenial-security/main amd64 DEP-11 Metadata [67.7 kB] Ig...

Ubuntu 16.04 LTS version .04 : VLC Installation

Preparing to unpack .../libqt5x11extras5_5.5.1-3build1_amd64.deb ... Unpacking libqt5x11extras5:amd64 (5.5.1-3build1) ... Selecting previously unselected package libxcb-xinerama0:amd64. Preparing to unpack .../libxcb-xinerama0_1.11.1-1ubuntu1_amd64.deb ... Unpacking libxcb-xinerama0:amd64 (1.11.1-1ubuntu1) ... Selecting previously unselected package obs-studio. Preparing to unpack .../obs-studio_21.1.0-0obsproject1~xenial_amd64.deb ... Unpacking obs-studio (21.1.0-0obsproject1~xenial) ... Processing triggers for libc-bin (2.23-0ubuntu10) ... Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ... Processing triggers for desktop-file-utils (0.22-1ubuntu5.2) ... Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20180209-0ubuntu1) ... Rebuilding /usr/share/applications/bamf-2.index... Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ... Processing triggers for mime-support (3.59ubuntu1) ... Setting up libfdk-aac0:amd64 (0.1.3+20140816-2) ... Setting up lib...