Skip to content

Instantly share code, notes, and snippets.

View Kagee's full-sized avatar
👾
Still working from home, what about you?

Anders Einar Hilden Kagee

👾
Still working from home, what about you?
View GitHub Profile
// Get amazon book list as JSON data
// Based on https://gist.github.com/yige233/274fbd29ba26a6f9d75d698c1790e0d5
// 1 open i.e. https://www.amazon.com/hz/mycd/digital-console/contentlist/booksAll/dateDsc/
// 2. Open developer console
// 4. If required, adapt the fetch url below.
// 5. If required ajust batchSize
// 6. paste into developer console and press enter
// 7. Promise {<Pending>} will appear
// 8. AFter a while a js structure starting with {success: true, .... should appear.
// 9. Right click that line, "Copy object"
@echo off
rem https://stackoverflow.com/a/5370380
rem Loop on multiple input files and auto
rem trim them using magick "!item_%%n!" -trim "!item_%%n!"
setlocal ENABLEDELAYEDEXPANSION
rem Take the cmd-line, remove all until the first parameter
set "params=!cmdcmdline:~0,-1!"
set "params=!params:*" =!"
set count=0
...
'ApacheSecureAuth' => array (
'apacheEnv' => 'REDIRECT_REMOTE_USER', # Eventuelt REMOTE_USER
'ldapServer' => 'ldap://ad.example.com',
'starttls' => true, # kommer i 2.4.169, burde fortsatt kunne bli med
'updateUser' => false,
'ldapProtocol' => 3,
'ldapNetworkTimeout' => -1,
'ldapReaderUser' => 'CN=srv_misp,OU=Service Users,DC=example,DC=com',
# For LDAP debug
# LDAPLibraryDebug 7
<VirtualHost *:80>
ServerAdmin serveradmin@misp.local
ServerName misp.local
Header always unset "X-Powered-By"
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
@Kagee
Kagee / MISP and LDAP using the ApacheSecureAuth module.md
Last active November 27, 2023 10:00
MISP and LDAP using the ApacheSecureAuth module

Important

- The ApacheSecureAuth / LDAP login code in MISP is a 
- 3rd party contribution and untested (including security)
- by the MISP-project team. However, you are free to enable
- it and report back to the developers if you run into any issues.
hildenae@spune:~$ echo "foo" | gist-paste
Please log in with `gist --login`. (Github now requires credentials to gist https://bit.ly/2GBBxKw)
hildenae@spune:~$ gist-paste --login
Obtaining OAuth2 access_token from github.
GitHub username:
GitHub password:
Error: Requires authentication
GitHub username:
GitHub password:
Error: Requires authentication
- name: loop test
gather_facts: no
hosts: localhost
vars:
- array_usage:
- id: 0
usage: 89
- id: 1
usage: 70
- id: 2
- name: loop test
gather_facts: no
hosts: localhost
vars:
- array_usage:
- id: 0
usage: 89
- id: 1
usage: 70
- id: 2
- name: loop test
gather_facts: no
hosts: localhost
vars:
- array_usage:
- id: 0
usage: 89
- id: 1
usage: 70
- id: 2
ii -s irc.homelien.no -n botname -i ./irc
echo "/join #some_channel" > irc/irc.homelien.no/in
tail -n 0 -f irc/irc.homelien.no/#some_channel/out | stdbuf -oL -eL grep -v -- '-!-' | sed -u -r -e 's/(")//g' -e "s/(')//g" -e 's/.*<([^>]*)>\s(.*)/{ "nick":"\1", "msg":"\2" }/' | while read D; do echo "$D"; curl
--header "Content-Type: application/json" --request POST --data "$D" https://home-assistant:8123/api/webhook/irc_tts; done
home-assistant/config/automations.yaml:
- id: 'irc-tts'