Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Wednesday, July 23, 2025

XAMPP untuk Linux Ubuntu

 XAMPP adalah paket perangkat lunak gratis dan open-source yang berisi Apache, MySQL/MariaDB, PHP, dan Perl. XAMPP memudahkan untuk membuat lingkungan server lokal untuk pengembangan web. 

Cara Install XAMPP di Ubuntu:
  1. Unduh XAMPP: Unduh file installer XAMPP untuk Linux dari situs resmi Apache Friends.
  2. Buka Terminal: Buka terminal di Ubuntu.
  3. Ubah Izin File: Ubah izin file installer agar dapat dieksekusi menggunakan perintah: chmod 755 xampp-linux-*-installer.run (ganti * dengan versi file yang diunduh).
  4. Jalankan Installer: Jalankan installer dengan perintah: sudo ./xampp-linux-*-installer.run.
  5. Ikuti Petunjuk: Ikuti petunjuk pada wizard instalasi.
  6. Jalankan XAMPP: Setelah instalasi selesai, jalankan XAMPP dengan perintah: sudo /opt/lampp/lampp start.
  7. Akses: Buka browser dan akses http://localhost atau http://localhost/phpmyadmin untuk phpMyAdmin. 

Monday, April 27, 2020

Jika Mount Linux Tetapi Hanya Read Only.. Ini solusinya {solved]

https://community.linuxmint.com/tutorial/view/1609

After partitions are created and you've installed Mint (or additional Linux distro's), create a mount point for the data partition:
sudo mkdir /mnt/DATA

Mount the partition:
sudo mount /dev/sda5 /mnt/DATA

Take ownership of the mount point:
sudo chown -R yourusername: /mnt/DATA

supaya ter mount otomatis.. edit fstab 

Wednesday, December 12, 2018

Editing files with vi

https://www.control-escape.com/linux/editing-vim.html

The thing you have to understand about vi and its work-alike editors is modality. Most programs have just one mode, accepting input and placing it at the cursor. This is what you probably expect from a program. But vi has other modes. When you start vi, you’ll be in “Normal” mode, which is really command mode. When you are in Normal mode, whatever you type is considered not to be input, but commands that vi will try to execute.
This may sound a little crazy, but it is actually a very powerful way to edit documents. Even if you hate it, the ubiquity of vi means that you’re going to need to learn the basics, because sometimes you just have to use it. On the other hand, if you enjoy working at a command line, then you may end uploving vi.

Lesson 1: How to Quit vi

Since vi is the default editor, there’s a good chance you got dropped into it without knowing it. This can be extremely frustrating if you don’t know your way around the program.
To exit vi without saving changes, hit Escape a couple of times to ensure you are in Normal mode, and then type:
:q!

Lesson 2: Editing with vi

Start vi and press i. The cursor may change shape, and INSERT is displayed at the bottom of the screen (in most vi clones). You are now in insert mode — all your keystrokes are entered into the current buffer and are displayed to the screen.
Hit the Escape key. The cursor changes shape again, and INSERT has disappeared. You are back in Normal mode. Hitting Escape a few times will pretty much always cancel whatever you are doing and return you to Normal mode.
Command mode is also where you move around in the file. On most systems, you can use the arrow keys to move the cursor. If that fails, cursor movement can be accomplished with the hjkl keys:
h   move left one character
j   move down one character
k   move up one character
l   move right one character
vi has its own command line, which you access by typing a colon. Commands typed at the command line will not be executed until you hit Enter, just like in the shell.
Many of the commands that you will use in command mode begin with a colon. For example, the command to quit is :q, as we learned in Lesson 1 above. Actually, in Lesson 1 we added !, which tells vi to “force” the operation. If you have edited the file, typing :q will not immediately exit the program, but instead produce this error message:
E37: No write since last change (add ! to override)
To save your changes, use the :w command (“Write”). You can save and quit all in one go by typing both commands together:
:wq
Of course, if you started vi without giving a file name, you’ll need to provide one. For example, to save your working file as test.txt, you would type:
:w test.txt
Try editing some text now.
  • Start vi
  • Hit i to go to Insert mode.
  • Type some text.
  • Hit Escape to return to Normal mode.
  • Type :w test.txt to save your work
  • Type :q to quit

vi Quick Reference

Movement

hjkl
left, down, up, right
$
To the end of the line
^
To the beginning of the line
G
To the end of the file
:1
To the beginning of the file
:47
To line 47

Editing

dd
Remove a line
5dd
Removing five lines
r
Replace a character
x
Delete a character
5x
Delete 5 characters
u
Undo last action
J
Join current and next lines (Note the capital — hold the Shift key)

Saving and Quitting

:q
Quit
:q!
Quit without saving
:wq
Write and quit
:w
Write (without quitting)
:e!
Reload currently open file from disk
:w test.txt
Write buffer to file test.txt
:e test2.txt
Open file test2.txt

Sunday, August 12, 2018

Using KDE Connect to Sync your Android Device with Your Linux Computer


https://www.makeuseof.com/tag/kde-connect-sync-android-linux/
http://www.webupd8.org/2017/04/new-kde-connect-indicator-ubuntu-linux.html
https://ubuntuforums.org/showthread.php?t=1654068
https://www.omgubuntu.co.uk/2017/01/kde-connect-indicator-ubuntu

Tuesday, March 20, 2018

recover deleted file in Linux

http://www.gnutoolbox.com/photorec-recover-deleted-files/
https://www.tecmint.com/photorec-recover-deleted-lost-files-in-linux/
https://www.larkinweb.co.uk/computing/recovering_lost_files_on_linux.html

https://stackoverflow.com/questions/16956810/how-do-i-find-all-files-containing-specific-text-on-linux

Monday, March 27, 2017

Sorting files according to size recursively

http://unix.stackexchange.com/questions/88065/sorting-files-according-to-size-recursively



51
down voteaccepted
You can also do this with just du. Just to be on the safe side I'm using this version of du:
$ du --version
du (GNU coreutils) 8.5
The approach:
$ du -ah ..DIR.. | grep -v "/$" | sort -rh

Breakdown of approach

The command du -ah DIR will produce a list of all the files and directories in a given directory DIR. The -h will produce human readable sizes which I prefer. If you don't want them then drop that switch. I'm using the head -6 just to limit the amount of output!
$ du -ah ~/Downloads/ | head -6
4.4M    /home/saml/Downloads/kodak_W820_wireless_frame/W820_W1020_WirelessFrames_exUG_GLB_en.pdf
624K    /home/saml/Downloads/kodak_W820_wireless_frame/easyshare_w820.pdf
4.9M    /home/saml/Downloads/kodak_W820_wireless_frame/W820_W1020WirelessFrameExUG_GLB_en.pdf
9.8M    /home/saml/Downloads/kodak_W820_wireless_frame
8.0K    /home/saml/Downloads/bugs.xls
604K    /home/saml/Downloads/netgear_gs724t/GS7xxT_HIG_5Jan10.pdf
Easy enough to sort it smallest to biggest:
$ du -ah ~/Downloads/ | sort -h | head -6
0   /home/saml/Downloads/apps_archive/monitoring/nagios/nagios-check_sip-1.3/usr/lib64/nagios/plugins/check_ldaps
0   /home/saml/Downloads/data/elasticsearch/nodes/0/indices/logstash-2013.04.06/0/index/write.lock
0   /home/saml/Downloads/data/elasticsearch/nodes/0/indices/logstash-2013.04.06/0/translog/translog-1365292480753
0   /home/saml/Downloads/data/elasticsearch/nodes/0/indices/logstash-2013.04.06/1/index/write.lock
0   /home/saml/Downloads/data/elasticsearch/nodes/0/indices/logstash-2013.04.06/1/translog/translog-1365292480946
0   /home/saml/Downloads/data/elasticsearch/nodes/0/indices/logstash-2013.04.06/2/index/write.lock
Reverse it, biggest to smallest:
$ du -ah ~/Downloads/ | sort -rh | head -6
10G /home/saml/Downloads/
3.8G    /home/saml/Downloads/audible/audio_books
3.8G    /home/saml/Downloads/audible
2.3G    /home/saml/Downloads/apps_archive
1.5G    /home/saml/Downloads/digital_blasphemy/db1440ppng.zip
1.5G    /home/saml/Downloads/digital_blasphemy
Don't show me the directory, just the files:
$ du -ah ~/Downloads/ | grep -v "/$" | sort -rh | head -6 
3.8G    /home/saml/Downloads/audible/audio_books
3.8G    /home/saml/Downloads/audible
2.3G    /home/saml/Downloads/apps_archive
1.5G    /home/saml/Downloads/digital_blasphemy/db1440ppng.zip
1.5G    /home/saml/Downloads/digital_blasphemy
835M    /home/saml/Downloads/apps_archive/cad_cam_cae/salome/Salome-V6_5_0-LGPL-x86_64.run
If you just want the list of smallest to biggest, but the top 6 offending files you can reverse the sort switch, drop (-r), and use tail -6 instead of the head -6.
$ du -ah ~/Downloads/ | grep -v "/$" | sort -h | tail -6
835M    /home/saml/Downloads/apps_archive/cad_cam_cae/salome/Salome-V6_5_0-LGPL-x86_64.run
1.5G    /home/saml/Downloads/digital_blasphemy
1.5G    /home/saml/Downloads/digital_blasphemy/db1440ppng.zip
2.3G    /home/saml/Downloads/apps_archive
3.8G    /home/saml/Downloads/audible
3.8G    /home/saml/Downloads/audible/audio_books

Wednesday, January 25, 2017

Exif metadata remover in linux

BISA

http://www.sno.phy.queensu.ca/~phil/exiftool/
http://www.linux-magazine.com/Online/Blogs/Productivity-Sauce/Remove-EXIF-Metadata-from-Photos-with-exiftool

Unix Platforms / Linux

  1. Download the Image-ExifTool distribution from the ExifTool home page
    (The file you download will have a name like "Image-ExifTool-10.40.tar.gz".)
  2. Unpack the distribution and make it your current directory by typing:
        cd <your download directory>
        gzip -dc Image-ExifTool-10.40.tar.gz | tar -xf -
        cd Image-ExifTool-10.40
    
    (At this point you may run exiftool by typing "exiftool <image file name>".)
  3. Test and install ExifTool by typing:
        perl Makefile.PL
        make test
        sudo make install
    
    (Note: The "make test" step is not required, but useful because it runs a full suite of tests to verify that ExifTool is working properly on your system. The "sudo make install" command requires that you have su access, and will prompt for your password. This will make ExifTool and its documentation accessible to all users on your system. If you don't have su access, you can run ExifTool in your own account by moving "exiftool" and its "lib" directory to any convienient location, preferably somewhere in your PATH.)
You can now run exiftool by typing "exiftool". Also, you can consult the ExifTool documentation with commands like:
perldoc exiftool
perldoc Image::ExifTool
perldoc Image::ExifTool::TagNames
or
man exiftool
man Image::ExifTool
man Image::ExifTool::TagNames
=============

https://apps.ubuntu.com/cat/applications/precise/phatch/    
https://launchpad.net/phatch  
http://photobatch.wikidot.com/

=================
BISA

http://www.xnview.com/en/xnconvert/#downloads
===================

https://hvdwolf.github.io/pyExifToolGUI/


http://www.makeuseof.com/tag/3-ways-to-remove-exif-metadata-from-photos-and-why-you-might-want-to/

Tuesday, January 24, 2017

E: Encountered a section with no Package: header E: Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_trusty_main_i18n_Translation-en E: The package lists or status file could not be parsed or opened. E: _cache->open() failed, please report.

https://forums.linuxmint.com/viewtopic.php?t=114923

You can remove the package lists, and then fetch them anew. To do so open a terminal and run the following two commands (one at a time):
CODE: SELECT ALL
sudo rm -fv /var/lib/apt/lists/*
sudo apt-get update

That should solve the MergeList issue.

Sunday, January 15, 2017

index_cpu.cgi causing 100% CPU spikes using Authentic Theme #410

https://github.com/qooob/authentic-theme/issues/410

Hi,
I think I have found a bug when using the Authentic Theme. Periodically when using the theme /usr/share/webmin/proc/index_cpu.cgi spikes to 100% CPU usage for about 5 - 10 minutes. I have been doing a bit of tracing and initially thought it was down to MySQL but under the processes tab of Virtualmin I found this to be the cause.
For now I have switched back to the Virtualmin Framed Theme and will monitor if this is indeed the cause. I am running a VPS on Digitalocean:
Ubuntu 14.04 LTS
1GB RAM
30GB SSD
2GB Swap
Anyone else had this issue?
Cheers
Dylan
@qooob
Owner
qooob commented on Feb 28, 2016
I have never experienced this issue and I truly doubt that it has anything to do with the theme.
@dylanrhysscott
Swapping back to Virtualmin Framed Theme has pushed this value down to 3% CPU usage I have been monitoring it for the last few hours. This person here also has had a similar issue when running the theme -http://www.webhostingtalk.com/showthread.php?t=1530070
@qooob
Owner
qooob commented on Feb 28, 2016
I understand. Every 5 minutes (300 sec), System Status, scheduled_collect_system_info also happens in Webmin Configuration->Webmin Scheduled functions.
It's not a bug. I have found out on my server (64gb RAM, SSD, and 12x2 CPU Cores), that index_cpu.cgigoes upto 4-5%. In case I switch to VM Framed Theme then it drops down to 0.4-0.5%. Well, it's true that Authentic Theme is more resourceful. When you reload index_cpu.cgi page it makes the whole theme load from the beginning and thus it uses a lot of CPU power. In case of not very powerful machine it will be 100%. In reality the load will not be there as long as you don't reload the page.
Thank you for reporting but it's not a bug. Theme does a lot of calculations and stuff upon load. I don't think I can help it. But overtime, that is for sure, I will try my best to do more and more optimizations, in case it's technically possible, to make theme shine in every possible way.
@qooob qooob closed this on Feb 28, 2016
@dylanrhysscott
Hi,
Thanks for your in depth answer it's most helpful. In some cases when I was on Virtualmin and SSHing into the VPS the SSH would suffer (i.e take longer to connect) . Its a fantastic theme and I love the look it gives but does raise some concerns when it max outs the CPU. Its true in the case of my low power VPS the CPU takes a hit. - If you need any more info from me drop me a line but great work and keep it up! Probably just needs some tweaking :)
@qooob
Owner
qooob commented on Feb 28, 2016
Thank you for your kind words and you are welcome.
I totally agree with you, that there is some room for code optimisation. Please understand, that making usable, optimised and great build (architect wise code) is a very very difficult task.
VPS is very specific. I remember, before having separate server, I couldn't even reload a page (http), when ffmpeg was running.
There should be a possibly on limiting CPU/RAM usage, this could be a solution.
Before I got a server of my own, I used to use ServInt - it was very good for me and I reccomend trying it.
@dylanrhysscott
Thanks for the recommend - Will take a look! Yeah I agree writing well optimized code is a daunting task. I come from a web development background and am constantly looking for ways to refactor it. Nothing on the same league as VM but still. Do you prefer dedicated over VPS then?
@qooob
Owner
qooob commented on Feb 28, 2016
Yes, I do.
Dedicated will provide much much better experience. However, it's all based on your tasks.

How to list all files ordered by size

http://unix.stackexchange.com/questions/53737/how-to-list-all-files-ordered-by-size

Simply use something like:
ls -lS /path/to/folder/
Capital S.
This will sort files in size.
Also see:
-S     sort by file size
If you want to sort in reverse order, just add -r switch.
Update:
To exclude directories:
ls -lS | grep -v '^d' 
Update 2:
I see now how it still shows symbolic links, which could be folders. Symbolic links always start with a letter l, as in link.
Change the command to filter for a -. This should only leave regular files:
ls -lS | grep '^-'
On my system this only shows regular files.
update 3:
To add recursion I would leave the sorting of the lines to the sort command and tell it to use the 5th column to sort on.
ls -lR | grep '^-' | sort -k 5 -rn
-rn means Reverse and numeric to get the biggest files at the top. Down side of this command is that it does not show the full path of the files.
If you do need the full path of the files, use something like this:
find . -type f  | xargs du -h | sort -rn
The find command will recursively list all files in all sub directories of .xargs will use the output of find as an argument to du -h meaning disk usage -humanreadable and then sort the output again.

List Files and Directories by Size on Linux

http://www.howtogeek.com/168135/list-files-and-directories-by-size-on-linux/
This page will show us how to create a list of files and folders ordered by size using standard Linux commands.

Command

To get a list with the size of each item in a folder, you’ll want to use the du command like this:
du -sm *
The -m argument will return the listing in megabytes (note that you can use -h for human readable, but it won’t sort correctly)
Now we will want to run this through the sort command, sorting in reverse order -r and numeric -n:
du -sm * | sort -nr
The only problem here is that we’ll get way too much output if there are a lot of files and folders, so we can either pipe it through the more command:
du -sm * | sort -nr | more
Or we can just return the top 15 largest items:
du -sm * | sort -nr | head -15
This will return a listing something like this:
2907    Files1
993     Files2
38      Somefile.txt