Skip to content

Instantly share code, notes, and snippets.

@brablc
brablc / katalog.xml
Created December 10, 2016 13:24
Shoptet Katalog
= Hlavicka XML
<?xml-stylesheet href="https://beta.shoptet.cz/user/documents/katalog.xsl" type="text/xsl"?>
<SHOP>
= Tělo XML
<SHOPITEM>
<PRODUCT>#NAME#</PRODUCT>
<ITEM_ID>#CODE#</ITEM_ID>
@brablc
brablc / from-macOS-utf8.sh
Last active November 6, 2016 18:50
macOS filesystem uses decomposed utf8 characters, they look the same but have different byte representation
iconv -f utf8-mac -t utf8
@brablc
brablc / Shoptet Admin Background Color.js
Created September 27, 2016 09:32
Tamper Monkey - Shoptet Admin Background Color.js
// ==UserScript==
// @name Shoptet Admin Background Color
// @namespace https://www.shoptet.cz/
// @version 0.1
// @description change bg color for admin!
// @author brablc
// @match https://beta.shoptet.cz/admin/*
// ==/UserScript==
(function() {
@brablc
brablc / GoogleTranslate.html
Created August 1, 2016 15:05
Google Translate Snippet
<div id="google-tr">
<div id="google_translate_element"></div>
<script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'cs'
}, 'google_translate_element');
}
</script>
<script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
if query == nil then
s = "users"
else
-- Remove part before @
s = string.gsub( query, ".*@", "")
-- Remove dots from selector
s = string.gsub( s, "%.", "_")
end
d = "smtp.shoptet.cz"
@brablc
brablc / pflogrep
Last active April 17, 2016 19:07
Grep Postfix MTA log for given email (or part of email) and all related communication
Moved to a repository:
https://github.com/brablc/postfix-tools
@brablc
brablc / import_contacts_from_groupoffice_to_roundcube.sql
Created April 9, 2016 19:21
Import address book to RoundCube from Group Office using SQL
-- ALTER TABLE roundcube.contacts ADD UNIQUE INDEX `uniq_email_user_id` (`email` (128), `user_id`);
SET @CrLf='\r\n';
SET sql_mode='PIPES_AS_CONCAT';
INSERT IGNORE roundcube.contacts
SELECT
NULL contact_id,
changed,
0 del,
IF(firstname,firstname || ' ','') || surname name,
@brablc
brablc / KeyTable.lua
Last active August 29, 2015 14:17
KeyTable.lua for opendkim
-- If there is no "@dkim" it means we did not get X-DKIM-Sender header, but From instead.
if query == nil or string.find( query, "@dkim$" ) == nil then
query = "default=news.shoptet.cz@dkim"
end
signer = string.gsub( query, "@.*", "")
-- Before =
s = string.gsub( signer, "=.*", "")
-- After =
@brablc
brablc / SigningTable.lua
Created March 19, 2015 11:36
SignigTable.lua for opendkim
-- On startup opendkim executes the script but does not give any query
if query == nil then
return "%"
end
return query
@brablc
brablc / dig_adisepo_output.txt
Created March 18, 2015 20:27
Portal danove spravy vypadava z Google DNS
$ dig adisepo.mfcr.cz
; <<>> DiG 9.8.3-P1 <<>> adisepo.mfcr.cz
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 14083
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;adisepo.mfcr.cz. IN A