How to use Lightroom and Photoshop without installing, directly as a web-application.
If you’ve subscribed Lightroom and Photoshop you’ve probably noticed that there are also Web versions of them (Photoshop is still in development). You can call them directly from your browser. Lightroom works in Linux too, Photoshop works in Windows or MacOs.If you want to use Photoshop in Linux, you have to install the “Chromium” Browser first. There is also an App version of Lightroom that works on Android or IOS devices. All data will be synchronized! So, you don’t have to worry about your cellphone photos anymore: they will be replicated to the Adobe cloud: The very good thing is: you’ll get 1 Terabyte of Cloud data if you decide to get the option for it (about 20 CHF a Month, Lightroom, Photoshop and a Premium light version included). You can call the Web-Version with these URL’s:
Well, you’ve got an older Mac (IMac or Macbook) that’s getting slower and slower. And: it’s already old (7 years or more). You’ll notice that your MacOs is not supported as it used to be. At the end it’s a real bore to work with your Mac. Now, you can do 2 things: if money isn’t a problem: you can buy a new one. But, if money IS a problem: why don’t you recycle it in a Linux working station? It’s definitely worth the price, it only cost you some time. The process is rather simple:
create a USB stick with a Linux distribution (in my case I used Ubuntu 22.x)
Stick the USB in your Mac, start it with ALT Power on and install it
Download a Linux ISO file and put it on the USB Stick with balena etcher (Search for Ubuntu download)
After the installation you’ll have a full functioning linux system FOR FREE! It supports even printing, scanning, watching movies, you’ll be suprised!
After this initial installation you want to have some comfortable menus. Go to “Ubuntu Software” and look for “alacarte” or “Main Menu” and install it
You can find it now in your installed programs (English main menu, German Hauptmenü) and you can use it
Now you want it to be accessible directly on your desktop like this:
Go to “Ubuntu Software” again and install “Extension Manager” (In German “Erweiterungs Manager”) Run it and Install “Applications Menu”
After the activation you’ll see the applications (In German “Anwendungen”) in the left corner on your screen
With “Main Menu/ Hauptmenü” you can see all the programs that are accesible. You can add new menus/items-
How to improve the visibility and Accessibility
Especially if you have an Imac 27 it can be important to improve the accessibilty. My recommendation/experience: activate High Contrast and Large Text, and make the Icons slightly bigger.
How to add Jetbrains programs
It is easily possible to add Jetbrains programs to the Linux system, here you can: create command-line launcher create desktop entry
In all Jetbrains programs there is a menu item “tools”.
How to add a printer
Normally you won’t have a problem to add a printer. But if you need to install a special printer like “Canon Pro” you have to install special software (printer driver) for Linux. I recommend TurboPrint
We all have this problem once in a while: there is a German document (in PDF or as an image) and we have to translate it in English (or Chinese if you like). Of course we use Google Translate! But how do we manage to get our text out of the PDF? There are some solutions: you could buy a program for that (Master PDF is very good), or, again, you can have it for free! All you have to do is to install 2 packages: “Tesseract OCR” and “OCR Feeder”. Tip: Install the complete Tesseract OCR with all languages. “OCR Feeder” is easy to understand (don’t use gImageReader: hard to understand) You can use OCR Feeder and scan your document directly, after the scanning is complete you can do the recognition: Document->Recognize document
In this project I’ll show you how to compare directories, save the result, and process the result: all combined in one attractive GUI.
The first thing we’ll do: we have to find the right tools/methods in Python: so I’ve googled on “python compare directories” and found this one on the official documentation:
fromfilecmpimport dircmp
def print_diff_files(dcmp):
for name in dcmp.diff_files:
print("diff_file %s found in %s and %s" % (name, dcmp.left,
dcmp.right))
for sub_dcmp in dcmp.subdirs.values():
print_diff_files(sub_dcmp)
dcmp = dircmp('dir1', 'dir2')
print_diff_files(dcmp)
I’ve changed the code like this:
def print_diff_files(dcmp): common_files = sorted(dcmp.common_files) for name in common_files: print("common_file %s found in %s and %s" % (name, dcmp.left, dcmp.right)) left_only_files = sorted(dcmp.left_only) for name in left_only_files: print("left_only_file %s found in %s" % (name, dcmp.left)) right_only_files = sorted(dcmp.right_only) for name in right_only_files: print("right_only_file %s found in %s " % (name, dcmp.left)) for sub_dcmp in dcmp.subdirs.values(): print_diff_files(sub_dcmp)
What is really amazing to me is the sheer amount of information you’ll get from this compare method: try to experiment with it in debug mode and you’ll see what I mean.
Start with the GUI first
We’ll build a very simple GUI to choose both directories. Afterward we’ll add an action to it. As a base project we will use this one: https://github.com/edleijnse/pythonGui
You’ll find the gui part in TaggerBizControlCentre.py
Now I’ve made a first button “compare from”:
self.btn_compare_from_dir = tk.Button(self.fr_buttons, text="COMPARE FROM directory", command=compareFromClicked, highlightbackground="cyan", bg="cyan")
While defining the button you can add a command to it, in this case: “compareFromClicked”. In the command you can define what happens after you clicked the button.
def compareFromClicked(): print("compare from clicked") mydir = open_directory(self.filearray[0], "directory to compare from") btn_compare_from_dir_txt_var.set(mydir) self.filearray[0]=mydir
The programmed action is like this: the program will ask you where to find the directory and store the value in 2 variabels: the first “btn_compare_from_dir_txt_var” is displayed as a label field right from the button. the second “self.filearray” is used to save the chosen directory.
In the same style I’ve added a “compare_to” button. And I’ve added 2 methods for saving and reading the data in a file called
In this project you’ll find a sample how to read items from Outlook, select some of them and save attachments to a directory. The filenames of the attachments are changed: there will be a receivement date added as a prefix to the filename
import win32com.client
import os
from datetime import datetime, timedelta
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
def extract_attachments(mailbox, restrictMessage, outputDir):
# Use a breakpoint in the code line below to debug your script.
print(f'Mailbox: {mailbox}') # Press Ctrl+F8 to toggle the breakpoint.
outlook = win32com.client.Dispatch('outlook.application')
mapi = outlook.GetNamespace("MAPI")
for root in mapi.Folders:
try:
if (mailbox in root.FolderPath):
print ("FolderPath: " + root.FolderPath)
for folder in root.Folders:
print("folder: " + folder.FolderPath)
messages = folder.Items
restrictedMessages = messages.Restrict(restrictMessage)
for message in list(restrictedMessages):
received = str(message.ReceivedTime)
print (message.SenderEmailAddress)
print (received[0:10])
receivedString = received[0:10] + "_"
for attachment in message.Attachments:
attachment.SaveASFile(os.path.join(outputDir, receivedString + attachment.FileName))
print(f"attachment {receivedString + attachment.FileName} saved")
except:
print("exception")
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
outputDir = r"f:\swissedu_attachments"
extract_attachments('ed@leijnse.info', "[SenderEmailAddress] = 'helena.dimi@windowslive.com'", outputDir)
# See PyCharm help at https://www.jetbrains.com/help/pycharm/
In this Python script you’ll find a sample how to traverse a directory with subdirectories, select Word document, extract the texts and make a new document file. At the end 2 summaries will be added: one with all the words and frequencies and another with the frequencies and words.
Sample “frequency / word”
37 we 38 about 38 from 38 this 39 B 39 C 39 D 39 YOUR 39 make 39 very 40 been 40 do 41 use 43 can 43 so 49 He 49 an 50 money
# This is a sample Python script.
from docx2python import docx2python
from collections import Counter
import os
import pandas as pd
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
def extract_words(filename, outputFile):
print("---------------------------------------------------------------------------")
outputFile.write("\n------------------------------------------------------------------------------------------------\n")
print(filename)
outputFile.write(filename+"\n")
print("---------------------------------------------------------------------------")
outputFile.write("------------------------------------------------------------------------------------------------\n")
doc_result = docx2python(filename).text
print(doc_result)
outputFile.writelines(doc_result)
# extract words in a table
res = doc_result.split()
return res
def print_tallied(sorted_tallied, outputFile, title):
#print(sorted_tallied)
outputFile.write(
"\n----------------------------------------------------------------------------------------------\n")
outputFile.write(title)
outputFile.write(
"\n----------------------------------------------------------------------------------------------\n")
ii = 0
for item in sorted_tallied:
if (item[1]>0):
if (item[0].isalpha()):
print(str(item[0]) + ":" + str(item[1]))
outputFile.write(str(item[0]) + ":" + str(item[1]) + "\n")
ii = ii + 1
print("total: " + str(ii))
outputFile.write("total: " + str(ii))
def sort_panda(tallied, outputFile):
outputFile.write(
"\n----------------------------------------------------------------------------------------------\n")
outputFile.write("summary words by frequency")
outputFile.write(
"\n----------------------------------------------------------------------------------------------\n")
ii = 0
wordTab = []
countTab = []
for item in tallied:
if (item[1] > 0):
if (item[0].isalpha()):
wordTab.append(item[0])
countTab.append(item[1])
print(str(item[0]) + ":" + str(item[1]))
ii = ii + 1
data = {'Count': countTab, 'Word': wordTab}
df = pd.DataFrame(data, columns=['Count', 'Word'])
df.sort_values(by=['Count','Word'], inplace=True)
for oneValue in df.values:
print(str(oneValue[0]) + " " + oneValue[1])
outputFile.write(str(oneValue[0]) + " " + oneValue[1] + "\n")
def word_document_reader(inputDir, outputFile):
# Use a breakpoint in the code line below to debug your script.
print(f'Hi, {inputDir}') # Press Ctrl+F8 to toggle the breakpoint.
import os
total_res = []
for path, currentDirectory, files in os.walk(inputDir):
for file in files:
filename = os.path.join(path, file)
if ("doc" in filename):
total_res = total_res + extract_words(filename, outputFile)
tallied = Counter(total_res)
sorted_tallied = sorted(tallied.items())
print_tallied(sorted_tallied, outputFile, "summary of words")
sort_panda(tallied.items(),outputFile)
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
inputDir = r"f:\swissedu_attachments"
outputFile = open(r"f:\swissedu.txt", "w", encoding="utf-8")
word_document_reader(inputDir, outputFile)
outputFile.close()
# See PyCharm help at https://www.jetbrains.com/help/pycharm/
If you want to have a flexible Webshop where the shop owner can add easily products / payments: then read this post!
I’ll explain two different kind of solutions. The first solution uses Ninja Forms and NF Views, the second solution uses Envira Galleries and Stripe.
Some background information
I was looking for a possibility to use the integrated WordPress database as a data store and I came up with the following idea. I use Ninja Forms as a form builder. Ninja Forms stores all the submitted data in the WordPress database and you can view it in “submissions”: quite comfortable for a start. But: I wanted more! I thought: wouldn’t it be possible to use this “submission” data store and build on top of it: first, some data views, later maybe reports as well. I was looking for plugins that could possible help me to solve this problem, and then I found “nf views”, https://nfviews.com/ It’s a very nice solution, the drawback could be the price (if you want to have the complete solution with the possibilty to edit the data as well, it will cost you around 200 USD on a yearly base) But: it saves you a lot of time, so, finally I leased this plugin and so far I’m very happy with the plugin. You always have to consider, even as a private programmer, what is cheaper in the end: make or buy. Buying can save you a lot of headaches. And, if you work with WordPress and plugins: you are the owner/data provider: it comes with responsability but also with freedom: you are not dependent on Cloud providers like Microsoft or Amazon. And, if you have a reliable provider like I do (Webland in Switzerland), it makes a lot of fun to build solutions with WordPress.
Webshop with configurable products
In this solution the webowner can easily add or modify products. You need to be an admin to configure the products.
Products overviewproduct imagepayment with Stripe (VISA / Paypall)
Move a window to one side of the screen: Press and hold the Option key while you move the pointer over the green button
in the top-left corner of the window, then choose Move Window to Left Side of Screen or Move Window to Right Side of Screen from the menu that appears. The window fills that half of the screen; the menu bar and Dock remain visible.