Thursday, June 30, 2022

Cloud Personal Computer

The cloud is in full swing in the world (:-). In the early days, the term “Cloud” was used to refer to application services (SaaS?) such as those represented by Salesforce.com, but nowadays, a variety of services have sprung up, and the so-called IT terms such as IaaS, DaaS, VDI, AVD, etc. are flooding the market, including service names. Even I, a self-proclaimed system engineer, have no idea what many of these terms mean, so I suspect that many people in the general public think that it is a strange and unfamiliar world.
 However, I believe that it is the responsibility of the specialists to ensure that their terminology is understood by non-specialists, so I think that engineers have a responsibility to define words in a unified, easy-to-understand manner, but I don’t see any such atmosphere in the IT industry (;-). However, it is a very unfortunate situation because I believe that there are many things in the Cloud that are actually useful for non-professionals to use.
 The dynabook N40 that my child was using at home was no longer being used, so I had been playing with Linux on it, but I was considering buying a new computer because I felt it had reached its limits, but then another idea suddenly came into my mind:

  • A second computer could be Cloud One?

Those of you in the IT industry or those who are already using it for work may be able to imagine it, but I am afraid that who not in the IT industry may have no idea what I mean (;-o). To put it simply.

  • Borrow a computer on the Internet and use it like a personal computer.

In this IT world, it is sometimes called VDI, but for me, it is more like

  1. Internet PC
  2. Cloud PC

I would like to name it either 1. internet PC or 2. cloud PC. It is indecisive of me to say that the definition of a word is important, but I am still unable to decide on one, but I would like to consider more and decide which term to use soon.

Labels: , , ,

Wednesday, June 29, 2022

Mini PC

I have Linux installed in my dynabook N40 and it is running smoothly, but it freezes frequently, which is not good for my mental health. However, I am not ready to go back to Windows now, and so I would like to buy a mini PC, which is very popular nowadays.
Until about 10 years ago, when Japanese PC makers were still active (:-o), I used to follow them like which makers’ new models had what CPU and so on, but recently I have not been following them at all, so I do not know any of the makers, but in the area of mini PCs, various new makers have entered the market. And many of them look so good in price comparison. I think this is also a new thing nowadays, but there are plenty of review videos on Youtube, etc., so you can consider the product with a clear image of what you will be doing after purchasing it. It’s a great time we live in (:-).
At the moment, candidates are Beelink, Minisforum, GMKTEC so far. seem to have good specs at around $500 , so I think those are good choices.

Labels: , , ,

Tuesday, June 28, 2022

Second Personal Computer

I am using a dynabook N40 with Ubuntu installed, but it freezes frequently, so I am considering buying a second computer. I think that one of the deciding points for a home computer was whether or not it could smoothly watch videos such as Youtube and Netflix a long time ago, but nowadays I think that such videos can be watched on FireTV, etc., I am using it with my REGZA’s HDMI and I watch it when I get tired of my Dynabook. The purposes of my home PC, excluding video viewing, can be generally categorized into the following, unless it is also used for work.

  1. game-related
  2. video editing
  3. investing in stocks, cryptocurrencies, etc.
  4. surfing the Internet (archaic word?).
  5. others

I guess it’s like that. In my case, it is “5. others” + “Linux-install-hollic” (archaic word? lol) . Therefore, I do not need a high-spec CPU, and then I am considering a mini PC or a stick PC about the same size as a FireTV.

Labels: , , ,

Monday, June 27, 2022

dynabook N40

I have Ununtu Japanese Remix installed on my dynabook N40 and external monitor, and using Sikulix, I am enjoying playing reasonably well, but I am actually feeling a limitation. . It was the same when I had CloudReady installed, but Frequent freezes. Sometimes it does not happen for a couple of hours, sometimes it happens every few minutes.
 It didn’t happen when I was using Windows 10, so I think there is a possibility to solve the problem, but I’m not sure if it’s a hardware problem? It is very stressful to investigate the hardware problem on a machine where it is occurring (;-).
 As expected, I think it would be better to buy a second computer that should be the base and to investigate the dynabook N40 problem, but…

  • Necessity is always the best teacher.

I am still on the fence because I feel that if I buy a new computer, I will never come back to the dynabook N40 (lol).
dynabook N40

Labels: , , ,

Friday, June 24, 2022

Sikulix Exception

I've been experimenting with Ubuntu on a dynabook N40 with sikulix, and I've made a lot of stupid mistakes right away (LoL). Well, that's how programmers gain experience. Yesterday, I made a mistake in handling "except".

#
def log_print(m): # debug print
    print(m) # print message.
#
print(App.openLink("https://google.com")) # open google.com in standard browser
try:
    wait("image.png",15) # wait 15 seconds at the longest until image.png is found
    log_prinh("Found.")
except: # if not found for 15 seconds, jump to here
    log_print("Not found.")
#
click() # without argument, left-click on the last match.

When you look at this source, then if aware "This is no good!", you have excellent taste! (LOL). Actually, it was running fine until halfway through and then suddenly stopped working (;-o). No matter how I tried, the images no longer matched. I took screenshots again and again, changed similar rate, and so on, but nothing worked. I thought it was a bug in sikulix. (That can't be it!))   Then, about half a day later, I somehow start feeling :

  • "except:" might be catching other exceptions than no image found??!!

I noticed that. I looked at the source carefully, and found that somehow, strange characters were mixed in with the functions I had defined (;-o). I was not sure why, but I found out that I had rewritten a function that I had not defined. Since python is a scripting language, so if I wrote a function that I had not defined, it would not give me a compile error, but would be handled as an exception at runtime, so the error message was absorbed by the exception and no longer appeared.
I almost blame python, but when I think about it, I remember that I have been doing the same thing in java for a long time, write all the exceptions into one except, and getting into trouble later. I haven't progressed at all. 。。。。 Of course, usually they code like this:

try:
    wait("image.png",15) # wait 15 seconds at the longest until image.png is found
    log_prinh("Found.")
except FindFailed: # if not found in 15 seconds, jump to here
    log_print("Not found.")

This way, even if you write a strange (undefined) function, it will not be hidden by an exception, and you will notice it immediately at runtime. If you want to handle other exceptions, you can do something like this.

try:
    wait("image.png",15) # wait 15 seconds  at the longest until image.png is found
    log_prinh("Found.")
except FindFailed: # if not found in 15 seconds, jump to here
    log_print("Not found.")
except Exception as e: # Other exceptions
    print("Error happen!!!!")
    print(e)
    exit(1)

Actually code successfly jumped to the last "except", because the function was wrong (:-o). The lesson of the day is.

  • Cutting corners code takes up your time in the future.

(LOL)

Labels: , , ,

Thursday, June 23, 2022

Sikulix Study

I'm learning coding on the subject of RPA with Ubuntu on my dynabook N40 (lol). sikulix's typical functions find() and wait() match if an image is on the screen, but after getting used to them a bit, I want to do more advanced things(lol) , like "except:".

#
def log_print(m): # print debug code.
    print(m) # print a message. 
#
print(App.openLink("https://google.com")) # open google.com in standard browser
try:
    wait("image.png",15) # wait 15 seconds at the longest until image.png is found
    log_print("Found.")
except: # if not found for 15 seconds, come back here
    log_print("Not found.")
#
click() # without argument, left-click on the last match.

With find() and exists(), the image has to be on the screen at the time of execution, but with wait(), it waits until the image is displayed, and if it is, it proceeds without waiting. If you run the above code with the debug (-v) option, you will get

java -jar sikulixide-2.0.5.jar -r . -v
:
[debug] Region: wait: image.png appeared ....... [8180 msec])
:

You can see that it waits about 8 seconds, including the startup time of the browser. You can set the maximum wait time as long as you want, but since unexpected things often happen (:-o), if it is too long, you will be left waiting when debugging (:-).
You can write separate processes for when the image matches and when it does not match, like this.

Labels: , , ,

Wednesday, June 22, 2022

Sikulix Similar

This is the third in the series of playing with RPA on a dynabook N40 with Ubuntu (lol). The sikulix editor is a great one that allows me to take screenshots and code as is. Sikulix editor I was even impressed by the convenience of this editor, as I have only programmed with vi for a long time back then (:-o).
After using sikulix for a while, I notice that there is a concept called "image accuracy". You might call it "recognition level". In other words, the logic is coded to click when the image saved in advance "matches" the actual screen, etc. This "match" is relatively "not exactly" (:-). Sikulix may click on a spot that is not even close to the humanly possible match, or conversely, they may be coldly told "Not found" even though the images should be exactly the same from human point of view. The need for this kind of fine-tuning is what makes sikulix a little different from other programming. The wonderful thing about sikulix is that this fine-tuning of "precision" can also be done from the editor. When you click on the cropped image, a window called "Pattern Settings" appears, with a tab called "Matching Preview". At the bottom, there is a slide bar that allows you to change the "Degree of Recognition". If you lower the "Recognition Level," the image will be judged as a "Match" if there is even a slight similarity, and if you raise the level, the image will be judged as a "Mismatch" even if there is only a slight difference. The need for fine-tuning in this area is typical of RPA, and there is a lot of room for ingenuity. I really respect those who are doing this for work, but not for fun. The result of such fine-tuning is as follows in python code.

click(Pattern("image.png").similar(0.90))

This means that the "recognition" is set to 90%. sikulix's editor is great, but it is a programmer's nature that once you get used to it, you will revert to editing this area directly in vi (lol).   By the way, you can fine-tune the position of the click on the image with the click() function by using "Target Offset" in the next tab. This can also be done with the mouse in the sikulix editor, but in coding, you can adjust it like this.

click(Pattern("image.png").similar(0.90).targetOffset(-275,20))

This one may be edited by vi directly... The following is the same sentence (:-).

Labels: , , ,

Tuesday, June 21, 2022

Sikulix Error

I'm playing with RPA on a dynabook N40 with Ubuntu and Sikulix, but at first I got an error when executing commands that handle images such as find(). It seems I'm missing a module.

$ java -jar sikulixide-2.0.5.jar -r .
[error] App: command wmctrl is not executable, the App features will not work
[error] App: command xdotool is not executable, the App features will not work
[error] findWindow:
[error] error in command [wmctrl, -lpGx].

This is how it looks like. In this case, you can simply install them on Ubuntu.

sudo apt install wmctrl xdotool

Sikulix seems to have a policy of being very user-friendly (lol), so when you get an error like this, you may be surprised when your browser suddenly starts up and jumps to the Sikulix github site. There, you see.

  • If you got here automatically,
  • You got an error something ~~, right? 
  • The solution is ~~.

They will kindly tell you how to solve the problem. It may be normal nowadays, but it is surprising that a program language can do this much for you at runtime.
However, in some cases, you may be running Sikulix stand-alone, or secretly (lol) behind the firewall of your company and accidentally connect to the outside using http, which may result in a security breach that you will be scolded later (lol). If you are running in such an environment, please be very careful (:-p). Sikulix Error Jump

Labels: , , , ,

Monday, June 20, 2022

Run Sikulix Scripts

RPA gives the impression of being a business improvement tool for today's companies, but it is also one of the so called "robots" in the world of the Internet. Sikulix is a great tool that is easy to use even for beginners, but please be careful how you use it with somehow unexpectedly heavy load. I downloaded the Sikulix java file and tried to run a simple script, but it is very annoy to launch the completed script from the integrated environment every time, and the editor is hidden during the execution, so you have to wait and see if the execution is going well or not, without even seeing the log. So, it is better to run the script from the command line.

$ java -jar sikulixide-2.0.5.jar -r source location

When I run it, I place browser and term like this: Run Sikulix Scripts Um, that's too easy work!, but isn't it enough? (:-)

Labels: , , , ,

Friday, June 17, 2022

Sikulix Beginner

I'm trying Sikulix on a dynabook N40 with Ubuntu Japanese Remix. Basically, everything that can be done on a PC since the mouse and keyboard are operable. Download jar file and just launch it.

$ java -jar sikulixide-2.0.5.jar

Then an editor will be launched. It is like an integrated development environment. Screen Shot: Sikulix Integrated Development Environment

There is a button to take a screenshot, so you can cut out a part of the computer you want to operate. If you want to click with the mouse, just take the shot so that it is in the center of the image to be cut out. Since this is a trial, I'll start with google.com open in firefox. The screenshot part is easy to see in the image image when opened in the sikulix integrated environment, but when you save and look at the source (.py extension) later, it is automatically converted to the filenamed one.

#Left click on the Google search window. Center of image
click("1655010823490.png",10) 
#Search for "sikulix"
paste("sikulix") 
# Type ENTER key
type(Key.ENTER) 
# wait 10 seconds for search results
wait(10) 
# Capture search results
filename = capture(App.focusedWindow()) 
# display the filename where the captured result is stored
print(filename) 

When executed, the editor automatically disappears from the screen and starts up again when finished. The execution log is displayed on the right side of the editor, and the filename where the captured image specified by print is saved is also displayed there. It seems that the capture results appear under /tmp in Linux. This is so interesting for various applications.

Labels: , , ,

Thursday, June 16, 2022

Sikulix

 Why am I installing Linux on such an old and slow (sorry!) computer like a dynabook N40? The reason is that not only it is just a hobby (:-o) itself, but also I want to try RPA, which is very popular nowadays. I love the fact that this almost discardable (sorry again!) computer is working day and night on behalf of people, gathering information from the Internet and performing a large amount of routine office work.

So I decided to install sikulix. The base is java, so all you have to do is download the jar file and run it. java is available in various versions, including oracle, but note that sikulix only works with open-JDK 11, which is the standard version of Ubuntu (although I did not test all of them).

And the standard script of Sikuli is python as usual nowadays. I've never used python, but I have a lot of experience with c and java, so I think I can handle it (I hope).

Labels: , , , ,

Wednesday, June 15, 2022

Audacity

 Computers and video/music content have developed by constantly balancing their compatibility with copyright issues. There have been the conflict between copy protection for CDs and DVDs and the law's limits on personal use. And recent advances in computer performance have made it possible to record computer screens with reasonable performance. On the other hand, the technology of the guarding side is also evolving. There are many cases where it is very useful in the range of personal use, and we want to use it while keeping in mind the scope of the law.

I tried using Audacity on Ubuntu Remix installed in my Dynabook N40, which is an audio editing software that is very easy to use, and the Windows and Linux versions are almost the same. By combining Audacity with your computer's audio settings, you can record the sound of your computer. In short, all you have to do is connect the sound output of your computer to the sound input of your computer. Of course, if you try to, you could also record audio from today's subscription services, but please be sure to comply with the laws of your country.

In the past, Windows used to allow you to connect "Output and Input" from the sound settings, but this is no longer possible by default, and you need to install an application such as voicemeeter, but I won't go into that here.

In Ubuntu on my dynabook N40, I installed Pavucontrol and was able to record with Audacity by tweaking the "Set as alternative" item in the "Input Devices" tab.

What you have to be careful of, of course, is that all the sounds of the computer are recorded, so if an error sound occurs during recording due to an operational error, that sound will be recorded as well (:-o). Moreover, Ubuntu Japanese Remix can change the warning sound to "dog" or "water" or "glass" (:-) on the settings menu , but I can't find an item to remove it completely at the moment (;-o). It seems that even if I set the setting volume to zero, the input to Audacity is not zeroed out. I'll try not to touch the dynabook N40 while recording for the time being (lol).

Labels: , , , ,

Tuesday, June 14, 2022

Touch Pad

I am writing this blog with Ubuntu Remix installed on a dynabook N40 and a REGZA connected to an external monitor, but when I start writing, the cursor jumps unexpectedly (;-o).

The "cursor jump" is a phenomenon in which the cursor jumps to a completely different place while writing, even though the mouse or touchpad is not touched. This phenomenon has been known for a long time, especially in the days when notebook computers were still low spec and slow, and many people may have had problems with this phenomenon, I guess.

There were various causes, such as static electricity, driver bugs, or actually touching the touchpad even when you think you are not touching it (:-o).

 The cursor jumping when writing long sentences is really stressful (;-o), and there was also a case that a person who used many shortcut keys and deleted all files by doing CTRL+A SHIFT+DEL in a completely different window than the one he wanted (:--o).

 Having had that experience in the past, I had already  a idea of how to solve the problem: I turned off the touchpad from the settings menu. Now the cursor no longer jumps when I am writing. I like the touchpad because it is convenient, but I don't want to use it for the time being, so I've given up on it.

Labels: , , , ,

Monday, June 13, 2022

HDMI

 I installed Ubuntu Local Language Remix on my dynabook N40, but there was a problem with unstable bluetooth, so very difficult to use it .

The other day I started using a Toshiba REGZA as an external monitor, and while I was doing so, I found that HDMI sound was recognized by Ubuntu when I opened the sound menu from the settings menu. I selected this option and the REGZA began to play sound (!!). This solved the problem, but for some reason, this setting reverted back to the original every time I rebooted the dynabook N40, so booting up and setting the sound became a routine task every time. This is tolerable, but I will give up bluetooth for the time being, because I don't have to worry for a while as long as I can hear sound, although the bluetooth instability problem of Ubuntu has not been solved (:-o).

Labels: , , , , ,

Sunday, June 12, 2022

bluetooth

 I have installed Ubuntu on my dynabook N40 and have been playing with it. Even though bluetooth was not working with the built-in one, but as with CloudReady, it is recognized if I use an external bluetooth chip. However, I noticed that the bluetooth was still very unstable while I was doing various things. The first time I tried to connect a speaker, I was relieved to hear sound, but after that, when I tried to connect a mouse and other devices, nothing appeared but "Searching for devices". On the contrary, the speakers that are supposed to be connected do not appear in the settings menu. The sound is coming out, so it should be connected, but it is not.

After restarting the computer several times and repeatedly turning bluetooth on and off, I found that the device "sometimes appears" (:-o). If I did not quickly register the device the moment it appeared, the next time it would not come up again (;-o). In addition, speakers that were supposed to be connected were sometimes disconnected.

I was able to use bluetooth  with CloudReady comfortably, so maybe Ubuntu bluetooth is unstable? But I'm sure there must be a solution, so I'd like to do some more research.

Labels: , , , ,

Saturday, June 11, 2022

TV Arm

 

I have installed Ubuntu on my Dynabook N40 and have been using it with REGZA as an external monitor, but my desk has become too small, so I installed an "Monitor ARM". Usually, I think it is used for monitors, but it can also be attached to TVs (depending on the model, of course), and as long as there are 10 cm square screw holes in the VESA standard, it can be installed in most cases (although sometimes it is difficult due to inaccuracy (:-)). Since I want to move the angle and height of the monitor freely depending on the work to be viewed, I purchased a slightly more expensive product from Sanwa Supply (probably a Japanese manufacturer) that can adjust its arm with gas pressure. Gas-pressure type arms have a specific weight range for the TV to be installed depending on the type, such as "5kg or less type" or "5kg to 10kg type" to choose from. What you have to be careful about is that this type is not "upward compatible. If you choose a higher type because you plan to replace it with a larger monitor later, you will end up with a monitor that jumps up high and won't come down (:o). So, I can move the TV freely to the left, right, up, and down, which is comfortable. The desk is also wider.


Labels: , , , ,