Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

Nov 18, 2024

NextCloud Install in Ubuntu Server

NextCloud is an Open Source, Self-Hosted or Cloud Hosted, File Sync and Sharing Platform. It's Secure, Private and Easy to use. Compatible with Windows, Linux, Android and Apple iOS devices.

This is assuming that you already have Ubuntu Server installed, patched and updated.

1. Download the latest version of NextCloud.

sudo wget https://download.nextcloud.com/server/releases/latest.zip


2. Install some required packages.


sudo apt install libmagickcore-6.q16-6-extra php php-apcu php-bcmath php-cli php-common php-curl php-gd php-gmp php-imagick php-intl php-mbstring php-mysql php-zip php-xml -y



3. Install Marid DB Server.

sudo apt install mariadb-server -y


4. Secure Marid DB installation, follow on-screen prompt and instructions.

sudo mysql_secure_installation


5. Configure Maria DB Server.


CREATE DATABASE nextcloud;

SHOW DATABASES;

GRANT ALL PRIVILEGES ON nextcloud.* TO 'ncuser'@'localhost' IDENTIFIED BY 'ncpass';

FLUSH PRIVILEGES;

QUIT;



6. Enable PHP Modules.

sudo phpenmod apcu bcmath gmp imagick intl


7. Install Unzip Apps.

sudo apt install unzip -y


8. Unzip the downloaded NextCloud file.

sudo unzip latest.zip


9. Copy and Rename the extracted NextCloud folder.

sudo cp nextcloud demo.com


10. Move the renamed folder to Apache server path.

sudo mv demo.com /var/www/


11. Grant permissions to NextCloud folder.

sudo chwon -R www-data:www-data /var/www/demo.com


12. Create Apache configuration file for NextCloud.


<VirtualHost *:80>
   ServerAdmin webmaster@local.com
   ServerName demo.com
   DocumentRoot /var/www/demo.com

   <Directory /var/www/demo.com>
     Options MultiViews FollowSymlinks
     AllowOverride All
     Order allow,deny
     Allow from all
   </Directory>

   ErrorLog /var/log/apache2/demo.com/error.log
   TransferLog /var/log/apache2/demo.com/access.log

  <IfModule mod_headers.c>
     Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
   </IfModule>

</VirtualHost>



13. Configure and modify PHP file. Modify the value according to your requirements.


memory_limit = 512M

upload_max_filesize = 512M

max_execution_time = 360

post_max_size = 512M

date.timezone = Asia/Kuala_Lumpur

opcache.enable = 1

opcache.interned_strings_buffer = 16

opcache.max_accelerated_files = 10000

opcache.memory_consumption = 128

opcache.save_comments = 1

opcache.revalidate_freq = 1



14. Enabled Apache modules for NextCloud use.

sudo a2enmod dir env headers mime rewrite ssl


15. Enable APCU module in PHP.

sudo nano /etc/php/8.3/mods-available/apcu.ini

add the following line :-

apc.enable_cli = 1


16. Open your favorite browser, such as Google Chrome browser. And type the URL of NextCloud server (eg. http://demo.com). At the main screen, you need to configure the NextCloud Database (eg. nextcloud) created earlier including its username (eg. ncuser) & password (eg. ncpass). You also need to create the First Administrator account with a valid email address too.


17. NextCloud screen will auto refresh upon successful connection to the database, now login with the new administrator account created in earlier step.


18. Secure NextCloud with Let's Encrypt SSL.

sudo certbot --apache


19. Fix missing Indices in NextCloud.

sudo chmod +x /var/www/demo.com/occ

sudo /var/www/demo.com/occ db:add-missing-indices

sudo chmod -x /var/www/demo.com/occ


20. Change permissions of NextCloud config file.

sudo chmod 660 /var/www/demo.com/config/config.php

sudo chown root:www-data /var/www/demo.com/config/config.php


21. Modify NextCloud configuration file.

sudo nano /var/www/demo.com/config/config.php

Modify the following lines according to you needs :-


'memcache.local' => '\OC\Memcache\APCu',

'default_phone_region' => 'MY',

'maintenance_window_start' => 1,

'filelocking.enabled' => true,

'memcache.locking' => '\OC\MemCache\APCu',



22. Restart Apache server.

sudo systemctl restart apache2


23. Configure Crontab.

sudo crontab -u www-data -e

Add the following line :-

00 * * * 1 php -f /var/www/demo.com/cron.php



OPTIONAL STEPS

24. Remove Skeleton Files and Folders when User account is created.

sudo rm -R /var/www/demo.com/core/skeleton/Templates


25. Remove Work Flow Engine, to prevent User from installing WorkFlow.


sudo /var/www/demo.com/occ config:app:set workflowengine user_scope_disabled --value yes



26. Install "Redis" as MemCache for NextCloud.

sudo apt install redis php-redis -y

sudo systemctl enable redis

sudo systemctl start redis

sudo nano /var/www/demo.com/config/config.php


'memcache.local' => '\OC\Memcache\Redis',

'memcache.locking' => '\OC\Memcache\Redis',

'redis' => array(
     'host' => '/var/run/redis/redis.sock'.
     'port' => 0,
     'timemout' => 0.0,
     ),


sudo nano /etc/redis/redis.conf


unixsocket /var/run/redis/redis.sock

unixsocketperm 660


sudo usermod -aG redis www-data

sudo systemctl restart redis


27. If Redis is distributed, add following line into NextCloud config file :-

'memcache.distributed' => '\OC\Memcache\MemCached',


28. To clear all NextCloud log entries.

sudo -u www-data truncate /var/www/demo.com/data/nextcloud.log --size=0



!!! HAPPY COMPUTING !!!


May 18, 2023

Android : Install Ubuntu via Termux

Install Ubuntu in Android Phone with Termux (No Root).

Official GitHub MFDGaming: https://github.com/MFDGaming/ubuntu-in-termux


Termux Terminal

  1. pkg upgrade -y
  2. pkg install wget -y
  3. pkg install proot -y
  4. pkg install git -y
  5. git clone https://github.com/MFDGaming/ubuntu-in-termux.git
  6. cd ubuntu-in-termux
  7. chmod +x ubuntu.sh
  8. ./ubuntu.sh
  9. ./startubuntu.sh

Once Ubuntu have started, just use it as normal such as updating the repositories

10. apt update && apt upgrade -y

After update, you can proceed to use as normal and install any packages you want.




!!! HAPPY COMPUTING !!!


Apr 17, 2023

Android : Add More RAM (Virtual RAM) on Android Phone

Android : Add More RAM (Virtual RAM) on Android Phone

How To Add More RAM (Virtual RAM) on your Android Phone. The "Virtual RAM" will use part of your phone's storage (ROM) & as such your ROM space must be sufficient before proceeding. Very useful when you many apps running simultaneously.



  1. At Android Phone, goto --> Settings.
  2. Browse and look for --> Battery and Device Care.
  3. Then, tap on the --> Memory.
  4. Next, tap on --> RAM Plus.
  5. Select the desired "Virtual" RAM size, you will need to restart the phone for it to take effects.


!!! HAPPY COMPUTING !!!



Mar 17, 2023

Android : Restore Original Firmware

One of my old phone have suddenly been bricked and kept on looping at reboot (boot loop) and yes its a Samsung Galaxy J5 2016 phone. The root caused was the firmware file corruptions during Android update. To fix this I need to manually download the original firmware version and to restore it as all other methods such as "Wipe Cache Partition" and "Wipe Data & Factory Reset" have all failed.


(A) BOOT INTO "DOWNLOAD" MODE.

1. Ensure the phone's battery have at least 50% of charge.

2. Standby the original Micro USB cable (must be data type cable).

3. Download the flash utility called ODIN (https://www.getdroidtips.com/odin-download-latest-odin-software/)

4. Download Samsung KIES software, this is only required if you haven't install the Samsung USB Drivers yet (https://www.samsung.com/my/support/kies/).

5. Download the latest firmware and search for your corresponding model (mine is J510GN, Malaysia), its the same source (https://updato.com/). You will need to register an account in order to download.

6. Ensure the phone is Power-Off.

7. Press --> HOME + VOLUME DOWN + POWER simultaneously and hold it for a few seconds.

8. When prompted, press --> VOLUME UP to proceed to download mode.


(B) CONNECT PHONE TO COMPUTER.

1. Ensure that Samsung KIES or Samsung USB drivers is already installed in the computer.

2. Once the phone is connected to the computer, wait for a few seconds for it to auto-detect and configure.

3. Now open ODIN tools.

4. Once ODIN is loaded, you should see the status "ADDED" and your phone is recognized.


(C) START FLASHING THE PHONE.

1. Extract the downloaded firmware, you can use any compression tools such as 7Zip.

2. In ODIN screen, click --> AP button and search for the downloaded firmware.

3. Now press --> START button to start uploading the firmware into phone. This may take some times so be patience with and don't disconnect or power-off the phone.

4. Once everything is completed, your phone will auto-restart itself. You can now disconnect it from the computer.

5. The first initialization will be very slow and the updating is also very slow, leave it run automatically and at times it may seems to be freeze (but it wasn't), also it will auto-restart several times thus please be very patience during this process.

6. Finally, you will be able to see the "Samsung" logo at boot and will eventually displayed the "Home" screen. That's simple.


!!! HAPPY COMPUTING !!!


Mar 15, 2023

Android : Install Termux Terminal Apps

Termux is a "Terminal Emulator" but due to its functions its been banned by Google Play Store and thus was no longer available for download.

But there is another way to do this via another store apps called "F-Droid" and can be easily done.

1) Open any web browser and type-in the following link (https://f-droid.org/en/).

2) At main page (shown below), click on the --> Download F-Droid button.



3) Your mobile or Android may display some warning messages, proceed to Allow the download.

4) Once download completed, it will try to auto-install but another warning message will be displayed. Just allow the installation or Enabled --> Allow installation from unknown source.

5) Once "F-Droid" have completed the installation, on your home screen or more apps screen the "F-Droid" icon will be shown. Now tap to Open the apps.

6) At the first start, there will nothing to display but don't be alarmed as the apps is now "Updating Repositories" and may take while to complete. Just leave as it until everything is updated.

7) Once the repositories is updated, the screen will shows you some popular apps. Tap on the "Search" icon and type-in --> Termux

8) There are many apps named "Termux" but look for the descriptions that says "Terminal....", select that apps and proceed to download and install.

9) As usual, your phone will prompt you some warning, proceed to Allow download and install as usual.

10) Once everything completed, you will now have "Termux" installed and the icon will be displayed at the Home screen or inside More Apps screen.


Edited : 18-May-2023, add video link.





!!! HAPPY COMPUTING !!!



Mar 5, 2023

Crypto : Duino Coin Mining on Android

 Mining Duino Coin (DUCO) on your old Android Smartphone devices. Please ensure you register a Duino Wallet before proceeding at (https://wallet.duinocoin.com/).

Take note that this methods which was tested on my devices, that includes :-

  • Samsung Galaxy J7+
  • HuaWei Nova 7 SE
  • Samsung Galaxy A02s
  • Samsung Galaxy J5 (2006)
As for other devices brand & model, you have to try your luck. I might update the list of tested devices from time-to-time but do keep in mind that these devices are owned by myself & no longer in use. At certain times you may need to "ROOT" your device in order to have the latest or most recent Android version.

(A) Install F-DROID Store.
  1. Just open any browser and search for --> F-DROID
  2. At the main page, click/tap on the "Download" button.
  3. You may be prompted some questions, just allow the installation (eg. "Allow from unknown source"), depending on your device, the syntax/wording maybe different so don't follow blindly.
  4. Once installed, open the "F-Droid" app and wait for it to update the repositories (it may a while depending on your device and internet speed).
  5. Once done, search for --> TERMUX (Terminal Emulator).
  6. Proceed to download and install. Additional prompt maybe displayed, just as usual allow it.

(B) In TERMUX Terminal.
  1. pkg update
  2. pkg upgrade -y
  3. pkg install wget proot git nano net-tools -y
  4. termux-setup-storage
  5. git clone https://github.com/MFDGaming/ubuntu-in-termux.git
  6. cd ubuntu-in-termux
  7. chmod +x ubuntu.sh
  8. ./ubuntu.sh
  9. Wait for the installation to complete.
  10. ./startubuntu.sh

(C) In Ubuntu Terminal.
  1. apt update && apt upgrade -y
  2. apt install wget proot git nano net-tools -y
  3. apt install python3 python3-pip python3-dev -y
  4. git clone https://github.com/revoxhere/duino-coin.git
  5. cd duino-coin
  6. pip3 install requests
  7. python3 PC_Miner.py
  8. The wizard will prompt you for your Duino Wallet information, proceed to key-in accordingly.
Note: You might want to adjust the Intensity=80/90 instead of 95.
Note: You might want to adjust the Cores=6/7 instead of full Cores use.

Once all completed, the system will start mining and about 1-2 minutes (maybe more) the miner information will be available in your Duino Wallet Dashboard.





!!! HAPPY COMPUTING !!!