Skip to content

Instantly share code, notes, and snippets.

View cmaggiulli's full-sized avatar

Chris Maggiulli cmaggiulli

View GitHub Profile
@hanleybrand
hanleybrand / canvas_data_dap_custom_download_names.py
Last active February 10, 2024 21:35
Importing instructure-dap-client and using it programatically - quickstart example scripts
import os
from pathlib import Path
import shutil
from urllib.parse import urlparse
from dap.api import DAPClient
from dap.dap_types import Format, IncrementalQuery, SnapshotQuery
import requests
output_dir_base = Path("downloads")
@tcartwright
tcartwright / GenericService.bat
Last active November 16, 2022 04:01
NSSM Generic Service, Generic service wrapper utilizing NSSM to execute a powershell script
@%~d0
@cd "%~dp0"
@set /p svc=<"%~dp0ServiceName.txt"
powershell.exe -ExecutionPolicy RemoteSigned -NoLogo -NonInteractive -NoProfile -file "%~dp0%svc%.ps1"
@echo Done
@cmaggiulli
cmaggiulli / A Short Primer to the Oracle bkup_api Utility.md
Last active November 11, 2019 10:22
A short introduction to Oracle's bkup_api utility. Directory structure is based on an Oracle DBaaS Classic VM 12.2.2

A Short Primer to Using the bkup_api Utility

If you are using Oracle Cloud you should be using the PSM for all of your Object Storage Container ( OSS ) and DBaaS Instance for all your backup needs. You should submit a support request before troubleshooting any of these issues, especially if you don't have a dev instance. The absolute path's I use in here are based off how a PSM provisioned instance of Oacle Cloud's DBaaS 12.2 Single Instance installed on Oracle Linux.

Path and Structure

The bkup_api is located in the /var/opt/oracle/bkup_api directory. If you intend to learn this utility on a development VM I suggest the first command you run is sudo -s. You will need to be root for the entirety of this post. You can run an ls -ltra to see the directory structure, but the only pertinent files/directories

  • drwxr-x---. 2 root root 4096 Mar 26 2019 log
  • -r-xr-xr-x. 1 oracle oinstall 1148 Oct 3 21:45 README
@cmaggiulli
cmaggiulli / oic-jwt-gen.sh
Last active November 15, 2019 06:25
A "hack" to steal a JSON Web Token from an Oracle Integration Cloud home page
#!/bin/bash
# Tested on 19.3.xx.xx.xxxx.x
set startIndex=533
set endInex=2404
set baseURI="https://production-hangme.uscom-central-1.oraclecloud.com"
curl "$baseURI/ic/home/token" -H 'Accept: test/html' -H 'Referer: https://productionic-lathamoic.uscom-central-1.oraclecloud.com/ic/home/' -H 'DNT: 1' -H 'Sec-Fetch-Mode: cors' --compressed -L -fields=script -o .jwt.htm 2>&1 | cat .jwt.htm | cut -c 533-2404
@cmaggiulli
cmaggiulli / kill-job.sql
Created September 4, 2019 16:37
Kills a expdp job. Need to replace C1 and OICIMPEXPUSER with the job name and job owner, respectively
DECLARE
h1 NUMBER;
BEGIN
h1:=DBMS_DATAPUMP.ATTACH('C1','OICEXPIMPUSER');
DBMS_DATAPUMP.STOP_JOB (h1,1,0);
END;
/
@chisler
chisler / django_views.md
Last active November 16, 2022 07:29
Approach to designing Django Views

Django Views

This is a pre-ADR doc, notes from the meeting about django-app design patterns.

JSON-like views vs Page-views

The objective is to write clear code.

Function based views

Use function based views for serving pages, react apps

# All scripts
```
--tamper=apostrophemask,apostrophenullencode,appendnullbyte,base64encode,between,bluecoat,chardoubleencode,charencode,charunicodeencode,concat2concatws,equaltolike,greatest,halfversionedmorekeywords,ifnull2ifisnull,modsecurityversioned,modsecurityzeroversioned,multiplespaces,nonrecursivereplacement,percentage,randomcase,randomcomments,securesphere,space2comment,space2dash,space2hash,space2morehash,space2mssqlblank,space2mssqlhash,space2mysqlblank,space2mysqldash,space2plus,space2randomblank,sp_password,unionalltounion,unmagicquotes,versionedkeywords,versionedmorekeywords
```
# General scripts
```
--tamper=apostrophemask,apostrophenullencode,base64encode,between,chardoubleencode,charencode,charunicodeencode,equaltolike,greatest,ifnull2ifisnull,multiplespaces,nonrecursivereplacement,percentage,randomcase,securesphere,space2comment,space2plus,space2randomblank,unionalltounion,unmagicquotes
```
# Microsoft access
```
@alecharp
alecharp / keep-jenkins-plugins-uptodate.groovy
Last active December 22, 2022 06:01
Simple groovy script to upgrade active plugins when new versions are available
jenkins.model.Jenkins.getInstance().getUpdateCenter().getSites().each { site ->
site.updateDirectlyNow(hudson.model.DownloadService.signatureCheck)
}
hudson.model.DownloadService.Downloadable.all().each { downloadable ->
downloadable.updateNow();
}
def plugins = jenkins.model.Jenkins.instance.pluginManager.activePlugins.findAll {
it -> it.hasUpdate()
@magnetikonline
magnetikonline / README.md
Last active June 5, 2024 01:05
NSSM - the Non-Sucking Service Manager cheatsheet.
@airtonix
airtonix / runserver.py
Created August 11, 2013 07:13
Management command that overrides the default runserver to provide `compass watch`
"""
License
=======
Do whatever you like.
Usage
=====
1. put it in your project