Skip to content

Instantly share code, notes, and snippets.

Param
(
[string]$PAT,
[string]$Organization,
[string]$Connstr
)
$SQLQuery = "TRUNCATE TABLE PersonalAccessTokens"
Invoke-Sqlcmd -query $SQLQuery -ConnectionString $Connstr
@ITler
ITler / download-springer.sh
Last active May 2, 2020 07:54
Parse free springer book CSV sheet and download titles
#! /bin/bash
# Input file should be based on downloadable Excel sheets, but saved as CSV file (field_delimiter=; string_delimiter=<empty>)
INPUT_FILE=${1}
INPUT_FILE_CONTENT_START_LINE=${2:-2}
URL_COLUMN_IDX=${3:-19}
assemble_download_file_basename() {
input_file="${1}"
url="${2}"
@MirKml
MirKml / azure-devopsAPI-curl.md
Last active January 9, 2023 13:48
Azure devops API curl queries
  1. Gets PAT - personal access token - from azure devops profile. See more on this page.
    You can use username:password from 'Alternate credentials', which is also in your profile.

  2. Use curl with -s - silent, doesn't print statistics. Use jq tool for pritty print json content.

> curl -s -u username:PAT -H "Content-Type: application/json" https://dev.azure.com/<organization>/_apis/projects?api-version=2.0 | jq

You can use authorization header directly from the bash tasks from some build/release pipeline with System.AccessToken pipeline variable

> curl -H "Authorization: Bearer $(System.AccessToken)" -H "Content-Type: application/json" \
@varqox
varqox / recording_application_and_microphone.md
Last active March 7, 2024 17:59
How to record multiple applications and microphone into one audio file on Linux using PulseAudio

How to record multiple applications and microphone into one audio file on Linux

Step 0. Terminology

Sinks are for output, sources are for input. To stream source to sink a loopback must be created. More shall you find there.

Step 1. Create output sink that will be recorded

Our output sink will be named recording.

pacmd load-module module-null-sink sink_name=recording sink_properties=device.description=recording
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@laurentperrinet
laurentperrinet / list_workspaces.py
Last active March 8, 2021 16:33
How can I list all existing workspaces in JupyterLab?
#!/usr/bin/env python3
"""
How can I list all existing workspaces in JupyterLab?
as answered @
https://stackoverflow.com/questions/52656747/how-can-i-list-all-existing-workspaces-in-jupyterlab/53011827#53011827
"""
import argparse
# construct the argument parse and parse the arguments
@paolocarrasco
paolocarrasco / README.md
Last active April 23, 2024 14:50
How to understand the `gpg failed to sign the data` problem in git

Problem

You have installed GPG, then tried to commit and suddenly you see this error message after it:

error: gpg failed to sign the data
fatal: failed to write commit object

Debug

@zmilonas
zmilonas / GDPR_CV.md
Last active January 14, 2024 19:04
Formułka do CV, resume, RODO GDPR Compliant resume formulae

Polski 🇵🇱

Wyrażam zgodę na przetwarzanie moich danych osobowych w celu rekrutacji zgodnie z art. 6 ust. 1 lit. a Rozporządzenia Parlamentu Europejskiego i Rady (UE) 2016/679 z dnia 27 kwietnia 2016 r. w sprawie ochrony osób fizycznych w związku z przetwarzaniem danych osobowych i w sprawie swobodnego przepływu takich danych oraz uchylenia dyrektywy 95/46/WE (ogólne rozporządzenie o ochronie danych)

English 🇪🇺

I hereby give consent for my personal data included in my application to be processed for the purposes of the recruitment process under the European Parliament's and Council of the European Union Regulation on the Protection of Natural Persons as of 27 April 2016, with regard to the processing of personal data and on the free movement of such data, and repealing Directive 95/46/EC (Data Protection Directive)

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active April 22, 2024 16:30
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).