import re
def parseCookieFile() -> dict:
''' parseCookieFile function used to convert
NetScape cookies file into a dictionary '''
cookies = {}
with open (COOKIES_FILE, 'r') as file:
for line in file:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Jira Dark Mode | |
// @namespace http://tampermonkey.net/ | |
// @version 1.0 | |
// @description Convert Jira to dark mode. | |
// @author Peter Evans | |
// @match https://*.atlassian.net/* | |
// @grant none | |
// @require https://cdn.walkme.com/player/resources/wmjQuery3315.js | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SCOPES='read write follow' | |
if [ "$#" = "1" ]; then | |
RESPONSE_APP=$(curl -XPOST -F 'client_name=DoYouSuckDicks' -F "redirect_uris=urn:ietf:wg:oauth:2.0:oob" -F "scopes=$SCOPES" -F 'website=https://example.org' https://$1/api/v1/apps) | |
CLIENT_ID=$(echo $RESPONSE_APP | jq -r .client_id) | |
CLIENT_SECRET=$(echo $RESPONSE_APP | jq -r .client_secret) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RunOutput(): | |
def __init__(self, returncode, stdout, stderr): | |
self.returncode = returncode | |
self.stdout = stdout | |
self.stderr = stderr | |
# the following three commands are adapted from https://kevinmccarthy.org/2016/07/25/streaming-subprocess-stdin-and-stdout-with-asyncio-in-python/ | |
async def _read_stream(stream, callback): | |
while True: | |
line = await stream.readline() |
Hi, I'd like to share with you how I got my Jenkins CI set up for my private GitLab projects. This is more like a sheet of notes of mine, but I hope it'll help someone as I haven't found any good tutorial for Jenkins+Gitlab on the web yet :D
- generate ssh keys on own server ->
PUBLIC
andPRIVATE
( no passphrase ) - go to GitLab profile settings -> SSH keys -> add
PUBLIC
ssh key to GitLab = this will allow your Jenkins server to access your GitLab - also create full access GitLab
API access token
for Jenkins on your gitlab profile settings and keep it
- install Git + GitLab plugin on Jenkins ( make sure they are enabled (ticked) in Jenkins !!!)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from requests.packages.urllib3.exceptions import InsecureRequestWarning | |
requests.packages.urllib3.disable_warnings(InsecureRequestWarning) | |
URL = "https://www.somesitewithbadssl.com" | |
headers = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:54.0) Gecko/20100101 Firefox/54.0","Connection":"close","Accept-Language":"en-US,en;q=0.5","Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8","Upgrade-Insecure-Requests":"1"} | |
response = session.get(URL, headers=headers, timeout=15, verify=False) | |
result = response.text | |
print (result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino | |
//needed for library | |
#include <DNSServer.h> | |
#include <ESP8266WebServer.h> | |
#include "WiFiManager.h" //https://github.com/tzapu/WiFiManager | |
std::unique_ptr<ESP8266WebServer> server; | |
void handleRoot() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import paho.mqtt.client as mqtt | |
from influxdb import InfluxDBClient | |
import datetime | |
# The callback for when the client receives a CONNACK response from the server. | |
def on_connect(client, userdata, flags, rc): | |
print("Connected with result code "+str(rc)) | |
# Subscribing in on_connect() means that if we lose the connection and | |
# reconnect then subscriptions will be renewed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Content-Type: application/rss+xml; charset=UTF-8'); | |
// suck in the query string variables | |
$feed_name = htmlspecialchars($_GET['fname']); | |
$list_name = htmlspecialchars($_GET['lname']); | |
// compose the api urls + other stuff depending on presence of playlist | |
if(isset($_GET['lname'])) { | |
$json_url = 'http://api.mixcloud.com/'.$feed_name.'/playlists/'.$list_name.'/cloudcasts/'; |
NewerOlder