[{"body":"","link":"https://Some-Useful.Info/categories/","section":"categories","tags":null,"title":"Categories"},{"body":"","link":"https://Some-Useful.Info/tags/clarity-theme/","section":"tags","tags":null,"title":"Clarity Theme"},{"body":"","link":"https://Some-Useful.Info/tags/markdown/","section":"tags","tags":null,"title":"Markdown"},{"body":"","link":"https://Some-Useful.Info/posts/","section":"posts","tags":null,"title":"Posts"},{"body":"","link":"https://Some-Useful.Info/","section":"","tags":null,"title":"Some Useful Info"},{"body":"","link":"https://Some-Useful.Info/tags/","section":"tags","tags":null,"title":"Tags"},{"body":"","link":"https://Some-Useful.Info/categories/technology/","section":"categories","tags":null,"title":"Technology"},{"body":"This Site is based on the Clarity Theme. This page is merely a summary page for me, showing me how to implement certain bits of markdown code\nemoji support added by 'enable_emoji = true' in the hugo.toml file\n\u0026#x1f648; \u0026#x1f649; \u0026#x1f64a;\nThe \u0026quot;Notices\u0026quot; shortcode enables you to call out pieces of information - sidebars, warnings, tips, etc.\nTo create a notice on a page, you can use the notice shortcode.\nYou use the notice shortcode, with the first parameter being one of note, info, tip, and warning. Then add a title for your note in quotes as the second parameter. The inner body of the note can be whatever markdown you want to create.\nThe following shortcode syntax within a markdown doc:\n1{{% notice note \u0026#34;Note\u0026#34; %}} 2This is a standard \u0026#34;note\u0026#34; style. 3{{% /notice %}} will render as:\nNote This is a standard \u0026quot;note\u0026quot; style.\nThe other three variants follow.\nInfo Here is the \u0026quot;info\u0026quot; style.\nTip Here is a \u0026quot;tip\u0026quot; variant of a notice.\nWarning Here is the \u0026quot;warning\u0026quot; flavor of a notice.\nAlso note that the content of a notice can contain anything you could put on a normal page - as shown below:\nComplex Notices are Possible! This is a notice that has a lot of various kinds of content in it.\nHere is a bulleted list With more than one bullet And even more than one level Code blocks are fine here, too....\n1public void SayHello() 2{ 3 Console.WriteLine(\u0026#34;Hello, world!\u0026#34;); 4} Productivity Booster! If you're using VS Code for your editing, copy the .vscode\\clarity.code-snippets file into a .vscode root folder on your repo. This will enable you to type note then \u0026lt;tab\u0026gt; then choose with up/down arrows which flavor notice you want, then \u0026lt;tab\u0026gt; again to provide a title, then \u0026lt;tab\u0026gt; to add your content!\nTo use the snippet, you need to first enable quickSuggestions for Markdown (one time only):\nGo to Preferences-\u0026gt;Settings then search for quickSuggestions Follow the link to Edit in settings.json Toward the bottom of the file, paste in the following JSON: 1\u0026#34;[markdown]\u0026#34;: { 2 \u0026#34;editor.quickSuggestions\u0026#34;: true 3 } Close and save the settings. YouTube Privacy Enhanced Shortcode This is a standard blockquote\n[!NOTE] Useful information that users should know, even when skimming content.\n[!TIP] Helpful advice for doing things better or more easily.\n[!IMPORTANT] Key information users need to know to achieve their goal.\n[!WARNING] Urgent info that needs immediate user attention to avoid problems.\n[!CAUTION] Advises about risks or negative outcomes of certain actions.\n","link":"https://Some-Useful.Info/posts/clarity-theme/","section":"posts","tags":["Markdown","Clarity Theme"],"title":"Theme"},{"body":"","link":"https://Some-Useful.Info/contact/","section":"contact","tags":null,"title":"Contacts"},{"body":"","link":"https://Some-Useful.Info/tags/pfsense/","section":"tags","tags":null,"title":"Pfsense"},{"body":" My take on a speedtest widget for pfsense.\nBeing a newcomer to pfsense I guess i'm still playing catchup, as the newbie when my download speeds are nowhere near what i'm paying for I suspect pfsense as thats the only thing that changed in my setup.\nKnowing what my broadband supplier is going to say I pre-empt this by doing my own diagnosis before calling them. I've disconnected everything from the back of my modem and plugged my laptop in directly, gone to www.Speedtest.net and hit the 'GO' button. Unfortunately the reading is no different (download speeds still suck). One thing is for sure: I've just wasted several minutes dismantling a perfectly good hardware install, now I just have a mass of cables near my modem which need to be plugged back in.\nSurely there's a better way to do the speedtest without having to completely dismantle my installation. After some headscratching involving search terms in Interweb's such as pfsense and speedtest, I came across a post where someone was asking for a tool within pfsense which did the testing for you. Ok I know its not recommended by netgate themselves but hear me out. If the tool is ran from the psfense box I am emulating plugging in my laptop directly into the back of my broadband modem and hence fulfiling the requirment from my broadband supplier that the rest of the devices be disconnected from the hub/router.\nMy search led to seeking a widget that filled my requirement. I didn't find one so i'm rolling my own.\nStep 1 How do I write a widget for pfsense ? um ... lets look in the pfsense guide under the section about Creating widgets, anyone as confused as me? coming from a hardware background what I am seeing is just programmer speak. So i'm applying a bit of artistic licensing here what I actually need is just a php file, a javascript file and an inc file.\nStep 2 What about the mechanism for measuring the speeds. Easy we can cheat here as the big Search giants are in on the act by pushing their own take on a widget that runs a test directly from the search results. We just need to borrow one we like the look off and wrap it up in our widget. The caveat here is that the utility will target a server which may not necessarily be close to you so the results will be lowered according to distance.\nHow about this for our utility ? courtesy of Microsoft looks clean enough\nURL: https://www.bing.com/widget/t/speedtest\nor this one from MLab.\nURL: https://www.measurementlab.net/p/ndt-ws.html\nMLab is a opensource provider of testing utilities (Google use this one via the API for its widget).\nStep 3 Putting it all together\nOk I lied when I said 3 files, we actually only need 2 as there is no logic so we can scrap the javascript file. No logic you say? Yep in my limited understanding, the way the widget files work is that the inc file is used to define things like the title bar text.\nThe php file is the wrapper for the widget, so in our case go grab the speedtest mechanism from Microsoft/MLab and then display it in the widget frame whilst applying boundaries to fix the viewable size of the mechanism as necessary.\nThe javascript file would be where we add the logic for any buttons or text boxes etc. we create, as we have no buttons created by us we don't need this.\nour simplistic code is then just the 2 files, the include (.inc) file\n1\u0026lt;?php 2/* File : /usr/local/www/widgets/include/SpeedTest.inc 3 * Author : Saquib 4 * Date : 10-03-2019 5 * 6 * This software is distributed on an \u0026#34;AS IS\u0026#34; BASIS, WITHOUT WARRANTIES 7 * OR CONDITIONS OF ANY KIND, either express or implied. 8 * 9 */ 10 11$SpeedTest_title = gettext(\u0026#34;Speed Test\u0026#34;); 12 13?\u0026gt; and the widget (.php) file\n1\u0026lt;?php 2/* File : /usr/local/www/widgets/widgets/SpeedTest.widget.php 3 * Author : Saquib 4 * Date : 10-03-2019 5 * 6 * This software is distributed on an \u0026#34;AS IS\u0026#34; BASIS, WITHOUT WARRANTIES 7 * OR CONDITIONS OF ANY KIND, either express or implied. 8 * 9 * URL Choices : https://www.bing.com/widget/t/speedtest 10 * https://www.measurementlab.net/p/ndt-ws.html 11 * 12 */ 13 14require_once(\u0026#34;guiconfig.inc\u0026#34;); 15 16?\u0026gt; 17 18\u0026lt;iframe 19 src=\u0026#34;Substitute the URL for the widget you want to use here.\u0026#34; 20 width=\u0026#34;498\u0026#34; 21 height=\u0026#34;500\u0026#34; 22 frameborder=\u0026#34;0\u0026#34; 23\u0026gt; 24\u0026lt;/iframe\u0026gt; to install this widget login to your pfsense router and navigate to Diagnostics-\u0026gt;Edit File-\u0026gt;Browse\nnavigate to /usr/local/www/widgets/include\nAt the end of the navigation file path add /SpeedTest.inc and press the save button to create a blank file within the .inc file location\nto refresh the view once the file is created just hit the browse button again\nClick the file name you just created and it should open it up in an editable state. Now just copy the code from above for the .inc file remembering to substitue the URL for the speedtest widget you want and save the changes by clicking the Save button Click Browse once the file has been saved and this will take you back to the contents of the include folder.\nNow navigate to /usr/local/www/widgets/widgets and create a blank file here call it SpeedTest.widget.php\nJust as before click this new file and copy the code from above for the Widget (php) and paste it into the new file before saving it.\nThat's all now we just need to return to our main dashboard page in psfense and add our widget\nclick the [+] And select our widget name\nhere we have it a SpeedTest widget which we can use graphically from within the pfsense dashboard\nand the Alternate one using the MLab test\nSince writing this post my Speed has returned to a more normal level hence the screen grab's showing closer to the 200Mbs. After all this though I do now have a widget which i can use without having to unplug everything from the back of the modem.\n","link":"https://Some-Useful.Info/posts/speed-test-widget/","section":"posts","tags":["speed-test","pfsense"],"title":"Speed Test Widget"},{"body":"","link":"https://Some-Useful.Info/tags/speed-test/","section":"tags","tags":null,"title":"Speed-Test"},{"body":" Me\nCurrently, I work for a large UK based retailer as part of an Engineering team. Previous roles had me pegged as the SME for infrastructure, the fountain of knowledge when it came to fulfilment centers and the go to guy to get automation in place when it came to moving infrastructure from one Datacenter to another (twice! - No we didn't have issues, we just outgrew the colo site at the first datacenter, then the second move was a DR and active-active implementation). Where possible we've used virtualisation including both XenServer and more recently VMWare to return the levels of consolidation we need.\nMy current role is one of learning Azure and the DevOPS side of thing's with the aspiration that at somepoint before retirement I can be called an Architect of something with the certification's to back it up.\nWhy?\nI read somewhere that said you should have a presence online, as a minimum it shows you understand the basics of technology and the internet. Not being online means only a small circle of people will ever know what you are capable of. Beside's:\nIf I don't write it down i'll forget it, in the past i've just added it to my Microsoft OneNote before sharing the pages with colleagues. Someone mentioned that I had Some Useful Info and it be may worthwhile sharing what I have with a wider audience. Writing\nI'm not a technical writer so everything I write is as simplistic as can be and hopefully easy to follow when it is an instrcutional guide. A previous manager of mine once said that the prefect document is one which can be given to the least technical person anywhere within your business, if that person can follow your instructions and deploy the same exact solution as you then you have achieved your goal. The guides and information are my own thought's idea's etc. with copious amounts of googling so you don't have to do it, hopefully you as the reader find something useful in what I have done and documented.\nEnjoy!\n","link":"https://Some-Useful.Info/about/about/","section":"about","tags":null,"title":"About"},{"body":"","link":"https://Some-Useful.Info/about/","section":"about","tags":null,"title":"Abouts"},{"body":"","link":"https://Some-Useful.Info/tags/azure/","section":"tags","tags":null,"title":"Azure"},{"body":" A single application solution for when Postman is one application too many.\nDue to the way Azure is delivered for the developer community at my place of work, all Internet facing systems need to be fronted by a Content Delivery Network. To ensure this rule is followed a scan is carried out to find any Public IP's. Any public IP's found which did not follow any form of exception process are passed on to the security team, where a suitable enforcer is dispatched to help the guilty party remediate the situation.\nTo enable me to do the requisite scan I just needed to make a rest call to the developer's subscription, pulling back any public IP's which may be present and the related resource(s). The requisite rest call was :\n1GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses?api-version=2019-09-01 The only downside was I needed to set values for my clientID, AppID and Client Secret. All of which would be in plain text and at risk of leaking to the big bad world if I didn't secure them. There are several places on the Internet where experts have given their respective take of how to secure this important credential set. Yes I could put them in something like Hashicorp's vault but i'd still need a credential of sort's to pull the information out at the time of consumption within the script\nWhile looking for information on securing the credential set I came across a blog post by Geert. Geert is found over at Mobilefirstcloudfirst.net, in his blog he highlight's using the same Rest client for Visual Studio Code that i'm using. Alas Geert still had the credential set in plain text as part of the Rest client's environment variables.\nAs I spend most of the day in VS Code, this piqued my interest. I have my VSCode setup so that I'm already connected to the Azure tenant using the 'Azure Account' plugin and i can also use 'az' commands against the subscription using the Azure CLI tools. I just need the script to point to the relevant subscription and pull back my report.\nMy plan was to use what I had available to me, namely I was already authenticated to Azure so just needed a valid access/bearer token. My script then became one of calling Azure and grabbing the access/bearer token and pushing it out to the VSCode Settings.json file.\n1\u0026lt;# 2Script Author : Saquib 3Script Name : Get-Token.ps1 4Script Date : 20-01-2020 5Script Purpose : Get my Access/Bearer token from Azure and push it into the VSCode session environment variables. 6#\u0026gt; 7 8$pathToSettingsFile = \u0026#34;C:\\Users\\Saquib\\AppData\\Roaming\\Code\\User\\settings.json\u0026#34; 9 10Write-Host \u0026#34;Getting Access Token from Azure\u0026#34; 11$Token = az account get-access-token | ConvertFrom-Json 12Write-Host $Token.accessToken 13 14$settingsFile = Get-Content -path $pathToSettingsFile | ConvertFrom-Json 15$settingsFile.\u0026#39;rest-client.environmentVariables\u0026#39;.local.token = $Token.accessToken 16$settingsFile | ConvertTo-Json -depth 32| set-content -path $pathToSettingsFile 17Write-Host \u0026#34;Access Token Stored\u0026#34; 18Exit Like many colleagues I prefer the ability to click a button to do something, this can be achieved with a task within VSCode. To create a task is simply a matter of creating a file in the .vscode folder called 'tasks.json' with the following contents :\n1{ 2 \u0026#34;version\u0026#34;: \u0026#34;2.0.0\u0026#34;, 3 \u0026#34;tasks\u0026#34;: [ 4 { 5 \u0026#34;label\u0026#34;: \u0026#34;Get-Bearer\u0026#34;, 6 \u0026#34;type\u0026#34;: \u0026#34;process\u0026#34;, 7 \u0026#34;windows\u0026#34;: { 8 \u0026#34;command\u0026#34;: \u0026#34;powershell\u0026#34;, 9 \u0026#34;args\u0026#34;: [ 10 \u0026#34;-ExecutionPolicy\u0026#34;, 11 \u0026#34;Unrestricted\u0026#34;, 12 \u0026#34;-NoProfile\u0026#34;, 13 \u0026#34;-File\u0026#34;, 14 \u0026#34;${cwd}/.vscode/Get-Token.ps1\u0026#34; 15 ], 16 }, 17 \u0026#34;linux\u0026#34;: { 18 // no linux command structure needed unless you are on a Linux machine. In which case 19 // the windows code should run as long as you are running powershell core. 20 }, 21 \u0026#34;presentation\u0026#34;: { 22 \u0026#34;reveal\u0026#34;: \u0026#34;always\u0026#34;, 23 \u0026#34;panel\u0026#34;: \u0026#34;new\u0026#34; 24 } 25 } 26 ] 27} then to get the button in the task bar we leverage the tasks plugin by actboy168. Once this is installed you should see Get-Bearer appear in the task bar ( as highlighted by the yellow box in the following graphic )\nwhich when clicked upon will grab the access/bearer token and put it into the settings.json file of vscode.\nFrom here you can consume it as you wish.\nTo close the loop: using the Rest Client with what we have built so far to get that public IP that should not exist ( and the resource to which it is attached if any as shown on line 23 in the response )\nThere you have it, ensure you are signed into Azure, click the 'Get Bearer' button ( highlighted in red below )\nWithin the script click 'Send Request' ( highligted in yellow )\nFinally we get a response showing the Public IP(s) within the target Subscription.\n","link":"https://Some-Useful.Info/posts/rest-client-in-vscode/","section":"posts","tags":["Rest-Client","VS-Code","Azure"],"title":"Rest Client in VS Code"},{"body":"","link":"https://Some-Useful.Info/tags/rest-client/","section":"tags","tags":null,"title":"Rest-Client"},{"body":"","link":"https://Some-Useful.Info/tags/vs-code/","section":"tags","tags":null,"title":"VS-Code"},{"body":"","link":"https://Some-Useful.Info/series/","section":"series","tags":null,"title":"Series"}]