Use the following command:
>mkvpropedit old_title.mkv --edit info --set "title=new_title"
The art challenges the technology, and the technology inspires the art.
Use the following command:
>mkvpropedit old_title.mkv --edit info --set "title=new_title"
Step 1 - Installa the following package
sudo apt install imagemagick
Step 2 - Use the following command:
convert *.jpeg my_pdf.pdf
The command above might yield an “operation not allowed” error. Fortunately, we
can easily fix it by executing:
sudo sed -i 's/^.*policy.*coder.*none.*PDF.\*//' /etc/ImageMagick-6/policy.xml
or better:
sudo gedit
/etc/ImageMagick-6/policy.xml
add or change the row at end of the file (just before </policymap>) with the following:
<policy domain="coder" rights="read | write" pattern="PDF" />
$pattern = '/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/'; if ($file = fopen("a.vcf", "r")) { while(!feof($file)) { $line = fgets($file); if (preg_match($pattern, $line, $matches)) echo $matches[0]."\n"; } fclose($file); }
sudo apt install mat2
mat2 filename.pdf # you will now end up with a file called filename.cleaned.pdf
mat2 --inplace filename.pdf # this will overwrite original file with the new one, effectively removing the original file
mat2 --show filename.pdf # this will show the metadata that will be removed, if any (similar to dry run)
Step 1: Create a python program called mergePDF.py
import PySimpleGUIQt as sg
import sys
import os
arg = sys.argv[1:]
current_working_directory = os.getcwd() + "/undefined.pdf"
current_working_directory = "/home/max/Scrivania" + "/undefined.pdf"
class Listbox(sg.Listbox):
def dragEnterEvent(self, e):
e.accept()
def dragMoveEvent(self, e):
e.accept()
def dropEvent(self, e):
data = window['LISTBOX'].get_list_values()
items = [str(v).replace("PySide2.QtCore.QUrl('file://", "").replace("')", "") for v in e.mimeData().urls()]
for x in items:
if (x[-4:].upper() != '.PDF'): items.remove(x)
data.extend(items)
window['LISTBOX'].update(data)
window.refresh()
def enable_drop(self):
self.Widget.setAcceptDrops(True)
self.Widget.dragEnterEvent = self.dragEnterEvent
self.Widget.dragMoveEvent = self.dragMoveEvent
self.Widget.dropEvent = self.dropEvent
file_list_column = [
[
Listbox(arg, size=(50, 10), enable_events=True, key='LISTBOX', select_mode="single"),
],
[
sg.Input(default_text=current_working_directory, key='FOLDER')
],
]
image_button_move_column = [
[sg.Button("Up")],
[sg.Button("Down")],
[sg.Button("Delete")],
]
image_button_action_column = [
[
sg.Button("Merge")
],
]
layout = [
[
sg.Column(file_list_column),
sg.VSeperator(),
sg.Column(image_button_move_column),
sg.VSeperator(),
sg.Column(image_button_action_column),
]
]
window = sg.Window("pdfMerge V1.0", layout, finalize=True, resizable=False)
window['LISTBOX'].enable_drop()
def retreive_elem_selected(element):
if element['LISTBOX']:
item = element['LISTBOX'][0]
else: item = ""
return item
def manage_up(item, mylist):
if item:
pos = mylist.index(item)
newpos = pos-1
if newpos>-1:
mylist.insert(
newpos,
mylist.pop(pos)
)
return mylist
def manage_down(item, mylist):
if item:
pos = mylist.index(item)
newpos = pos+1
mylist.insert(
newpos,
mylist.pop(pos)
)
return mylist
def manage_delete(item, mylist):
if item:
mylist.remove(item)
return mylist
def manage_merge(mylist,myfile):
if myfile:
str1 = " ".join(str("\""+x+"\"") for x in mylist)
os.system("qpdf --empty --pages "+ str1 + " -- " + myfile)
else: sg.popup('','The output field is empty')
while True:
event, values = window.read()
item_selected = retreive_elem_selected(values)
mylist = window['LISTBOX'].get_list_values()
if event == sg.WINDOW_CLOSED:
break
if event == 'Merge':
manage_merge(mylist,window['FOLDER'].get())
if event == 'Up':
window['LISTBOX'].update(manage_up(item_selected,mylist))
window['LISTBOX'].set_value(item_selected)
if event == 'Down':
window['LISTBOX'].update(manage_down(item_selected,mylist))
window['LISTBOX'].set_value(item_selected)
if event == 'Delete':
if item_selected:
pos = mylist.index(item_selected)
window['LISTBOX'].update(manage_delete(item_selected,mylist))
mylist = window['LISTBOX'].get_list_values()
if mylist:
if pos < len(mylist):
window['LISTBOX'].set_value(mylist[pos])
else: window['LISTBOX'].set_value(mylist[-1:])
window.close()
Step 2: create a bash file mergePDF.sh to run the mergePDF.py#!/bin/bash
python3 /home/max/batfile/Py/mergePDF.py "$@"
where /home/max/batfile/Py/ is the path where your python file is stored
in my case into /home/max/.local/share/nautilus/scripts
Use as Program or script: c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe
and as arg use -executionpolicy bypass -file "C:\Temp\example.ps1"
where example.ps1 contain your script
https://www.home-assistant.io/
# Example script integration containing script syntax script: example_script: sequence: # This is written using the Script Syntax - alias: "Turn on ceiling light" service: light.turn_on target: entity_id: light.ceiling - alias: "Notify that ceiling light is turned on" service: notify.notify data: message: "Turned on the ceiling light!"