Skip to content

Instantly share code, notes, and snippets.

View regme's full-sized avatar
🤠

Andrey Katamanov regme

🤠
View GitHub Profile
#CHECK THE PATH ON LINE 2 and the FEED on LINE 3
cd "C:\users\scott\Downloads"
$a = ([xml](new-object net.webclient).downloadstring("https://channel9.msdn.com/Series/CSharp-101/feed/mp4"))
$a.rss.channel.item | foreach{
$url = New-Object System.Uri($_.enclosure.url)
$file = $url.Segments[-1]
$file
if (!(test-path $file)) {
(New-Object System.Net.WebClient).DownloadFile($url, $file)
}
@so0k
so0k / README.md
Last active August 7, 2023 06:16
Alpine-shell

Getting an Alpine shell

Often usefull for in-cluster debugging.

$ kubectl run --generator=run-pod/v1 --image=alpine:3.5 -it alpine-shell -- /bin/sh

detach (without killing the container):

@subfuzion
subfuzion / curl.md
Last active June 20, 2024 13:48
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@fearthecowboy
fearthecowboy / example.msbuild.xml
Created January 6, 2015 15:32
Super Simple PowerShell task for MSBuild.
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- @FearTheCowboy's Simple PowerShell Task for MSBuild -->
<UsingTask TaskName="PowerShell" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll">
<ParameterGroup><ScriptBlock ParameterType="System.String" Required="true" /></ParameterGroup>
<Task><Reference Include="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll"/><Code Type="Class" Language="cs"><![CDATA[
public class PowerShell : Microsoft.Build.Tasks.Exec {
public string ScriptBlock {set { EchoOff=true; Command = string.Format( "@powershell \"Invoke-Command -ScriptBlock {{ $errorActionPreference='Stop'; {0} ; exit $LASTEXITCODE }} \"", value.Replace("\"","\"\"").Replace("\r\n",";").Replace("\n",";").Replace("\r",";")); } }
}]]></Code></Task>
</UsingTask>
@davidfowl
davidfowl / dotnetlayout.md
Last active June 17, 2024 12:44
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@Morley93
Morley93 / openvpn.md
Last active April 28, 2024 08:44
This is how you can take an openvpn .ovpn config file and extract the certificates/key required to import the profile into NetworkManager.

OpenVPN .ovpn manipulation.

This is how you can take an OpenVPN .ovpn config file and extract the certificates/keys required to import the profile into NetworkManager.

  • Download the .ovpn file. Save it somewhere you can store it permanently (I use ~/.vpn).
  • Copy from between <ca> tags into ca.crt, remove <ca> tags.
  • Copy from between <cert> tags into client.crt, remove <cert> tags.
  • Copy from between <key> tags into client.key, remove <key> tags.
  • Copy from between <tls-auth> tags into ta.key, remove <tls-auth> tags.
  • Remove the line "key-direction 1"
  • Above "# -----BEGIN RSA SIGNATURE-----" insert the following lines.
@cuppster
cuppster / 1.cs
Created September 3, 2012 18:39
Promises for C# using Generics
/*
modified from original source: https://bitbucket.org/mattkotsenas/c-promises/overview
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Promises
@saich
saich / profiler.js
Created June 26, 2012 06:00
window.performance.now() wrapper for profiler use
/**
* @constructor
*/
function Profiler() {
}
/**
* Uses the best resolution timer that is currently available.
* The return value of this can only be used for measuring the time interval,