Skip to content

Instantly share code, notes, and snippets.

@cloudflying
cloudflying / Readme.md
Created Oct 26, 2017
Backup Link Lists - Shopify
View Readme.md

##Backup your Navigation Menus on Shopify

NOTICE: FREE FOR USE, no warranties or liabilities for misuse of the following code - use at your own risk!

  1. Create a new page template - in your Shopify Code Editor
  2. Paste the code in the page.linkbackup.liquid gist below
  3. Create a new page on your site and set the template to the name you used in step 2.
  4. Navigate to the page, right click and hit VIEW SOURCE.
  5. Save text of source somewhere as a backup.
View StartPlexSyn6_1.md

Try the following: Connect to the synology nas using SSH and "ADMIN ACCOUNT" and issue the following commands:

sudo su (This command will ask por admin password)
cd /var/packages/Plex Media Server/scripts
./start-stop-status start

To verify it is running yo can issue the following command:

ps -fea | grep target/Plex\ Media
View dns-verify.ps1
Function Get-DNSValid
{
[CmdletBinding()]
PARAM ($websiteUrl, $company)
## Company should be the string value of NETNAME in a ARIN whois lookup.
## To find out your value, open http://whois.arin.net/rest/ip/8.8.8.8.txt and copy the value (replace 8.8.8.8 with your IP)
## website url can be any DNS resolved value (even internal if using internal DNS system)
$primaryResult = Resolve-DnsName -Name $websiteUrl -Type A -DnsOnly;
View Generate Full SQL Query - Parameters ADDED
Public Function ActualCommandTextByNames(
ByVal sender As IDbCommand) As String
Dim sb As New System.Text.StringBuilder(sender.CommandText)
Dim EmptyParameterNames =
(
From T In sender.Parameters.Cast(Of IDataParameter)()
Where String.IsNullOrWhiteSpace(T.ParameterName)
).FirstOrDefault
If EmptyParameterNames IsNot Nothing Then
@cloudflying
cloudflying / sql-executescalar.vb
Created Aug 28, 2012
grab a single value from sql
View sql-executescalar.vb
Using conn As New SqlConnection(connectionString)
Using cmd As New SqlCommand
With cmd
.Connection = conn
.CommandText = "SELECT value FROM table;"
.Connection.Open()
Dim var as string = .ExecuteScalar()
.Connection.Close()
End With
End Using
@cloudflying
cloudflying / web.config
Created Aug 26, 2012
Web.config url rewrite
View web.config
<rewrite>
<rules>
<rule name="rw_page_address" stopProcessing="true">
<match url="^url/value/([_0-9a-z-]+)"/>
<action type="Rewrite" url="aPage.aspx?msg={R:1}&amp;value=2"/>
</rule>
</rules>
</rewrite>
@cloudflying
cloudflying / twilio-make-a-call.vb
Created Aug 26, 2012
Make a Phone call with Twilio
View twilio-make-a-call.vb
Imports System.Net
Imports System.Text
Imports System.IO
Public Function makeaCall() as string
Dim AccountSID As String = "aaaaaaa"
Dim authToken As String = "123"
Dim uri As String = "https://api.twilio.com/2010-04-01/Accounts/" & AccountSID & "/Calls"
Dim data As String = "From=+15551234567&To=+15557654321&Url=http://twimlets.com/message?Message[0]=You%20have%20successfully%20called%20me!&Method=POST"