Linux Find Command

ExamplesCreated by @dan_nanni on Instagram

find . -name “my.txt” find all files named “my.txt”

find .-type d-name “mydir” find all directories named “mydir”

find . -type f-name “*.jpg” find all “.jpg” files

find . -type f-size +100M find all files larger than 100MB

find . -type f-size +100M-size -500M find files with a specific size range

find . -type f-mtime-1 find all files modified in last 24 hours

find .-mtime-7-mtime +1 find files modified betn yesterday & a week ago

find . -type f-name “*.tmp” -delete find and remove all “.tmp” files

find . -type f-perm 0777 find all files with “777” permission

find . -type f-perm-u+x find all files executed by the user

find . -type f-name “*.txt” -exec cat {} \; find and cat all “*.txt” files

find . -type f-amin-60 find all files accessed within the last hour

find . -type f-user dan find all files owned by the user “dan”

find .-type f-ctime -2 find files created within last 2 days

find .-maxdepth 1 -name “my.txt” search only in current dir

find . -type f-name “*.txt” | xargs chmod 644 chmod all “.txt” to 644

find . -type f-name “*.jpg” | xargs tar -cf img.tgz archive all “.jpg” files

find . -type f-name “*.png” | xargs -I {} mv {} /tmp move all “.png” files

find . -type f-name “*.txt” | xargs grep “Hello” search for Hello in “.txt”

find .-xtypel-delete find and remove all broken symbolic links

find .-type d-empty-delete find and remove all empty directories

find .-newermt “2024-01-01”! -newermt “2024-03-15” use a time range

做人要學會保護自己

  1. 你不讓他佔便宜,就是你自私。
  2. 你不接受他們的價值觀,就是你固執。
  3. 你不肯接受他們的指揮,就是你強勢。
  4. 你一旦站在道理上不肯退讓了,就是你態度問題。
  5. 你差到他們的陰謀時,你太敏感了。
  6. 他們一旦發現你沒有那麼好騙,就是你們不懂事。
  7. 你一旦要勝利了,他們發現了就要輸,你就是世界第一大反派。

別因為一時的成功,而得以忘形

別因為一時的成功,而得以忘形 ,隨便發表自己的個人想法,從而導致身邊的人感受不良好,不舒服。這會直接為自己造成重大影響,損害個人形象。我們必須要記住,沒有人喜歡聽另一個人講大道理,特別是這些道理他們不接受,為了自己,讓自己成為一個謙虛的人謙卑的人,就是保護自己最好的方法。 別忘記,當你成功時,同時代表人家失敗。人家為什麼要高興呢? 不喜歡人家過得比自己好,是很多人的內心世界,沒必要讓這些人不高興,以為自己造成傷害。再溝,只不過是一些少許的成就,有必要炫耀嗎?就算要炫耀,都必須要對自己有幫助下,才有意義,傷害自己毫無意義也可言。

避免無目的地開玩笑

為了顯得幽默風趣,有些人經常刻意地逗人開心,但這種行為往往會因思考速度不夠快而不慎冒犯他人,這些無意義的言論不僅傷害了別人,也傷害了自己。

我們需要認真思考一下,開玩笑是否具有必要性和重要性?除了讓對話變得有趣外,其餘的效果往往是負面的。

有一位女士曾經說過,如果說的話不好聽,不如不說,只說些正面的話語。這種做法對於自己和他人都是有益的。

讓我們來分析一下,拿別人的缺點開玩笑有意義嗎?還是用他人的優點來逗人開心更好一些?

通過思考,看來已經找到答案。

nextCloud upgrade hints

Use command line for upgrade nextCloud was bester than using Web Upgrade. Some reason not work with Web upgrade.

Using the command line for upgrading NextCloud is more efficient than using the web upgrade interface. There are several reasons why the command line method is preferable:

Upgrade Duration: Upgrading NextCloud can take several hours, and when using the web upgrade, it’s difficult to gauge whether the process is progressing or if it has encountered issues and halted.

Error Handling: Upgrades can sometimes result in errors that require intervention. When using the command line, it provides more detailed information about any issues encountered, making it easier to take corrective actions. In contrast, the web upgrade may not provide sufficient information to diagnose and fix problems effectively.

PHP Configuration: To upgrade NextCloud, PHP often requires the apc.enable_cli=1 configuration. This configuration may not always be set correctly when using the web upgrade, causing upgrade issues.

In summary, utilizing the command line for NextCloud upgrades offers better control, error visibility, and ensures the necessary PHP configurations are in place for a smoother upgrade process compared to the web upgrade interface.

Make the nextCloud Folder work with same User and same permission

My Web Directory: /var/www/nextcloud
My Apache user: apache2

chown -R apache2: /var/www/nextcloud

nextCloud Upgrade

sudo -u apache2 php --define apc.enable_cli=1 /var/www/nextcloud/updater/updater.phar

sudo -u apache2 php --define apc.enable_cli=1 /var/www/nextcloud/occ upgrade

sudo -u apache2  php --define apc.enable_cli=1 /var/www/nextcloud/occ maintenance:mode --off

The database is missing some indexes

sudo -u apache2  php --define apc.enable_cli=1 /var/www/nextcloud/occ db:add-missing-indices 


不要浪費時間在無關緊要的人身上

昨晚我做了一個奇怪的夢。在夢中,我感到自己即將離開這個世界,但不像一般的夢境,我不是躺在床上,而是自由自在地四處走動。我來到一個公共廁所,卻看到許多人毫無秩序,場面混亂。當時,我感到自己非常鎮定,就像在一場漫遊旅行中一樣,充滿輕鬆感。然後,突然間我停下來,思考了一下。我想,既然我即將離開這個世界,有什麼非常重要的事情我應該處理呢?

突然,我想起了我最愛的孫女、最愛的兒女、最愛的太太,以及我最愛的家人。那一刻,我心中只有一個念頭,那就是盡快見到我的家人,然後我才能夠安心離開這個世界。但是,當時我感到非常無奈,因為我無法立刻回到他們身邊。

突然,女兒打來電話,詢問我在哪裡,我才知道孫女和家人都在等著我。於是,我趕緊回到殯儀館,見到了他們最後一面。但在回去的途中,我又突然想去理髮,並與一名理髮師老闆聊了起來,情緒愉快。我竟然忘記了家人的重要性,即將面對最後一面,為什麼我會這樣呢?我真的在責備自己,覺得自己太過放縱,總是容易被無關緊要的事情吸引,最終卻後悔不已。

這個夢境讓我反思,在現實生活中,我經常因為過度放縱自己,忽略了重要的事情,最終感到後悔。我應該時刻提醒自己,最重要的是我的家人,我的至愛。我願意為了保護他們而奉獻一切,因此,無論何時,我都不應該再將時間浪費在無關緊要的事情上。即使死亡即將來臨,我也應該學會改變,珍惜每一刻,並注重真正重要的價值。

Battery Auto Charger Specification Design

An advanced four (seven) stage charging program is written inside the automatic charger. While the battery is fully charged, the service life of the battery can be effectively extended.

Soft start
At the moment when the charger is energized, the power is buffered from small to large, which has a buffering protection effect on the charger when it is started.

Constant current
At this stage, the charger outputs the rated current for fast charging to increase the charging rate. The voltage of the battery gradually increases. At the same time, in order to prevent the battery from being overcharged, the charging voltage of the charger is limited to a safe value range. When the charging voltage rises to the set value, the charging current will begin to decrease slowly. At this time, the charger enters the constant voltage charging stage and continues to replenish the battery.

Constant voltage
At this stage, the charging current of the charger will gradually decrease, which can reduce the heating and vaporization of the battery and effectively avoid premature damage to the battery due to excessive aging. When the battery capacity reaches approximately 90%, the indicator light will briefly turn orange and the charger will enter the top-off phase.

Float charge
At this stage, the charger only outputs a lower voltage and smaller current to charge the battery. In this way, 100% capacity of the battery can be guaranteed at any time, and the battery will not bear unnecessary burdens, so as to prolong the service life of the battery as much as possible. At this time, the indicator light is green, which means that the battery capacity is basically fully charged.

Basic Information

Input Voltage : 100 ~ 240Vac, Min. 90Vac, Max 265Vac

Target Battery Voltage : 12V Lead Acid Battery

Output Current: Max. 6A

Output Power: 72W

Operation temperature : -40°C, +85°C

Automatic function: Auto Start/Stop

Meter: Voltage, Amp Current

Output Protect: Output reverse connection protection

Input

Frequency: 47~63Hz

Efficiency: >85%

Leakage Rate: <3.5mA/240Vac

Surge Current: 12A/230Vac

AC Current: 0.36A/230Vac

Output

Open Circuit Voltage: 13.8Vdc

Max. Output Power: 72W

Max. Output Current: 6A

Recommend Battery capacity: 18~90Ah

Open Circuit power waste: <1.3W

Voltage ripple: ≤50mV

Voltage precision: ≤1%

Battery Leakage current: <30mA

Battery Class: Lead Acid Battery

Protect

Output overload protect: The charger will stop its output when the voltage exceeds or reaches ≥14Vdc, with the Red LED indicator turning ON. It will resume operation when the output voltage falls below 14Vdc.

Over current / Short circuit: Limited current

Temperature protect: When the ambient temperature exceeds 30°C, the charger’s rated output power will gradually decrease as the temperature rises. Once it exceeds 60°C, the charger will stop outputting power. When the temperature drops below the cutoff point, the charger will automatically restore normal output.

Cooling method: Nature cool

Function

Start mode: Soft start

Constant current: When the main battery voltage drops below ≤ 12.5Vdc, the charging output pressure is activated for fast charging to increase the charging rate. At this time, the indicator light(L) will illuminate in red

Constant voltage: When the charger’s output voltage reaches 13.9Vdc and remains relatively stable, the charging current gradually decreases. This helps reduce battery heating and vaporization, effectively preventing excessive aging and premature damage to the battery. At this time, the indicator light(L) will illuminate in red

Float charging: When the battery capacity reaches 90%, the charger enters the float charging stage to continue replenishing the battery. At this time, the indicator light (L) will in green.

Environment

Operation temperature: -20°C ~ +50°C

Storage temperature: -40°C ~ +85°C

Operating humidity: 20~90%Rh

Storage humidity: 0~95%Rh

Vibration resistance: 10~500Hz 2G 10 minutes/cycle, x/y/z axis 60 minutes

Auto start/stop control

Auto stop charge: When the changing voltage exceeds ≥13.8Vdc, the charging current will continue to gradually decrease. When the charging current drops below 0.6A, the charger will automatically stop outputting power.

Pulse charging: It is a timely replenishment control method for the natural consumption of the battery, which not only keeps the battery in the best working condition at all times. It can also minimize the vaporization of the battery and the sulfide corrosion reaction of the plates,
avoid early damage and aging of the battery, and effectively extend the service life of the battery. At this time, the indicator light (R) lights green intermittently.

Auto activate charging: When the battery voltage is ≤13.2Vdc , the charger will automatically activate and return to the corresponding charging state.

Alarm

Relay alarm: When the battery voltage is ≤12.5Vdc or when the charger fails to output, the relay contact is closed.

Indicator light alarm: When the output voltage of the charger is ≥14Vdc, the charger stops outputting, and the indicator light (R) is red at this time.

Reverse protection

When the charger’s output terminal is connected reversely, the charger stops output; when the reverse connection is removed, the charger will automatically resume output (when the battery voltage is higher than 5Vdc): If the battery voltage is lower than 5Vdc at this time, you need to protect it first.
When the power supply of the input terminal is confirmed to be normal, disconnect the output terminal and then connect the output terminal, the charger will automatically restore the output.