Skip to content

Instantly share code, notes, and snippets.

@nsapa
nsapa / exchange_ews_enable.py
Last active July 20, 2022 12:28
Enable X-Mailer & X-Received on EWS email for a specific account
#!/usr/bin/env python
# python -m pip install -U exchangelib
from exchangelib import Credentials, Account, Configuration, ExtendedProperty, Message, Mailbox
# Microsoft doc: https://docs.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-provision-x-headers-by-using-ews-in-exchange
# ExchangeLib doc: https://ecederstrand.github.io/exchangelib/#extended-properties
class XReceived(ExtendedProperty):
property_name = 'X-Received'
property_type = 'String'
@nsapa
nsapa / Firmware.txt
Last active April 19, 2022 02:39
Alcatel Omnipcx
04:05:31 [nico@Lyoko:~/temp … l/R103_064_001/DownloadingItems/bootl] $ binwalk -e boot-loader.bin
DECIMAL HEXADECIMAL DESCRIPTION
--------------------------------------------------------------------------------
173528 0x2A5D8 CRC32 polynomial table, big endian
221788 0x3625C U-Boot version string, "U-Boot 1.3.0-rc3 (Nov 26 2015 - 16:16:13) 3EH30350ABAJ bootl100/001.009"
228972 0x37E6C uImage header, header size: 64 bytes, header CRC: 0xF6826BF7, created: 2015-11-26 10:46:50, image size: 10092 bytes, Data Address: 0x200000, Entry Point: 0x201D24, data CRC: 0x87F5A952, OS: Firmware, CPU: PowerPC, image type: Standalone Program, compression type: none, image name: "aleboot.bin"
239128 0x3A618 uImage header, header size: 64 bytes, header CRC: 0xE8415BBF, created: 2015-11-26 10:46:50, image size: 2850 bytes, Data Address: 0x200000, Entry Point: 0x200750, data CRC: 0x2A4DB81, OS: Firmware, CPU: PowerPC, image type: Standalone Program, compressi
@nsapa
nsapa / ia_webp_to_jpg.sh
Created April 19, 2022 01:31
Convert webp thumbnail to jpg on IA item
#!/bin/bash
set -o errexit # abort on nonzero exitstatus
set -o nounset # abort on unbound variable
set -o pipefail # don't hide errors within pipes
set -x
URL=${1}
TEMP_DIR=$(mktemp -d)
@nsapa
nsapa / cvs_to_git.md
Last active April 19, 2022 01:15
cvs to git for github

(Inspired from Sourceforge' CVS convertion documentation)

We are using pearpc as example:

  • List all CVS module by going to the CVS page (ie: pearpc,utils,www) : http://pearpc.cvs.sourceforge.net/
  • Install the required software: dnf install coreutils sed cvs rcs rsync curl git git-cvs
  • Get the whole CVSroot: rsync -a a.cvs.sourceforge.net::cvsroot/pearpc/ pearpc_cvs
  • Export the list of every authors: ``for vfile in find pearpc_cvs -name '*,v';
@nsapa
nsapa / generator.yml
Created January 14, 2022 23:25
prometheus-snmp-exporter: generator.yml: Ruckus module with Unleashed override
ruckus:
walk:
- sysUpTime
- interfaces
- ifXTable
- ruckusCommon
- ruckusZD
- ruckusSCG
- ruckusSZ
- ruckusCTRL
@nsapa
nsapa / generator.yml
Created January 14, 2022 23:23
prometheus-snmp-exporter: generator.yml: Override the wrong type for Synology OID
# Synology
#
# Synology MIBs can be found here:
# http://www.synology.com/support/snmp_mib.php
# http://dedl.synology.com/download/Document/MIBGuide/Synology_MIB_File.zip
#
# Tested on RS2414rp+ NAS
#
synology:
walk:
@nsapa
nsapa / ia_fix_thumbnails_webp.sh
Last active November 29, 2020 16:48
Fix some thumbnails upload by tubeup on IA
#!/bin/bash
set -e
function parse_file() {
if [ $( (echo $1 | grep "Web/P image") | wc -l) -eq 1 ]; then
echo "Web/P image"
return
fi
echo "unknow file format"
return
@nsapa
nsapa / check_ia_youtube.sh
Last active June 2, 2023 22:35
Checking if tubeup have done the work
#!/bin/bash
# Check if we have a copy of an youtube item on IA
set -e
function die {
echo $1
exit 2
}
#!/usr/bin/env python3
import os
import sys
import xml.etree.ElementTree as ET
tree = ET.parse('yahoogroup_info_grab_files.xml')
root = tree.getroot()
for file in root:
# [('name', 'AO3_story_dump_continuing_reviews.xml'), ('source', 'original')]
@nsapa
nsapa / wikiteam_dystify_hacks.diff
Last active August 27, 2020 22:34
Patch on WikiTeam/wikiteam for grabbing https://wiki.dystify.com
diff --git a/dumpgenerator.py b/dumpgenerator.py
index 3193fe2..e09cd68 100755
--- a/dumpgenerator.py
+++ b/dumpgenerator.py
@@ -497,8 +497,10 @@ def getUserAgent():
""" Return a cool user-agent to hide Python user-agent """
useragents = [
# firefox
- 'Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0',
- 'Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0',