Temp directory on root drive runs out of space when PUTing a large file into Apache - linux

I'm putting (via curl on a client) a 10GB file up into an Apache server on Ubuntu Linux (v17.04). The root drive was pretty much full, and the ultimate destination for the PUT is a subversion root that is on a huge drive that's not root. The only other technology involved is mod_dav_svn.
How to move the tmp folder for Apache to that root drive too?

In modern Apache2 installs there's a /etc/apache2/envvars file that can happily have a line added to set the TMPDIR environmental variable.
Reboot Apache and it'll pick that up and run with it.
I've tested it over and over, and it works well (free space on the boot drive does not jeopardize the PUT of the large file).

Related

Make existing or already installed root file system encrypted

I'm having an existing manjaro linux installation and my root file system is not encrypted. How do i encrypt my file system without reinstall or lossing any data. Is it possible to copy root file system to another encrypted drive using live cd then make that as my root file system. Can anyone guide me on this.
/dev/sda1 is my root file system which is of size 80gb
/dev/sda2 is my swap which is of size 4GB
superuser.com is more relevant for this kind of questions.
Check out this answer, which uses cryptsetup-reencrypt to do an offline in-place encryption of a block device, e.g. a partition.
If that doesn't suit you, you can also create an encrypted partition and copy files using rsync -a /old /new.

How to extract/decompress this multi-part zip file in Linux?

I have a zip file thats titled like so file1.zip,file2.zip,file3.zip,etc...
How do I go about extracting these files together correctly? They should produce one output file.
Thanks for the help!
First, rename them to "file.zip", "file.z01", "file.z02", etc. as Info-ZIP expects them to be named, and then unzip the first file. Info-ZIP will iterate through the split files as expected.
I found a way. I had to mount the remote machines user home folder on my Ubuntu desktop pc and use File Roller Archive Manager, which is just listed as Archive Manger in Ubuntu 18.
Mount remote home folder on local machine...
Install sshfs
sudo apt install sshfs
Make a directory for the mount. Replace remote with whatever folder name you want
mkdir remote
Mount the remote file system locally replacing linuxusername with the user account you want to use to login and xxx.* with its IP address or hostname.
sudo sshfs -o allow_other linuxusername#xxx.xxx.xxx.xxx:/ remote
Now in the mounted "remote" folder you can see the contents of the whole linux filesystem and navigate them in a File Manager just like your local file system, limited by user privileges of course where you can only write to the home folder of the remote user account.
Using Archive Manager I openened up the .zip file of the spanned set (not the .z01, .z02 etc files) and extracted inside the "remote" folder. I saw no indication of extraction progress, the bar stayed at 0% until it was complete. Other X Windows based archive applications might work.
This is slow, about 3-5 megabytes per second on my LAN. I noticed Archive Manager use 7z to extract but do not know how as 7z is not supposed to support spanned sets.
Also if your ssh server is dropbear instead of openssl's sshd it will be unbearably slow for large files. I had to extract a 160gb archive and the source filesystem was fat32 so was not able to combine the spanned set into one zip file as it has a 4gb file size limit.

Can I delete the Matlab installation file in root user home directory

I just found Matlab (2016a) put a 2.5 Gb installation files that it fetched during the installation in the root home directory (Linux mint 18), under /root/Downloads/MathWorks. I guess it is probably because I use sudo for installation.
My question is:
Is it normal that program store information when user executes it with sudo?
Can I delete the file under /root/Downloads? (My limited Linux knowledge told me do not touch anything in the /root folder)
When you execute anything with su...do, you basically execute it 'as' root.
Mathworks uses the Download-Folder (which is in your case /root/Downloads - since you have executed the installer as root) for temporary data (According to https://de.mathworks.com/matlabcentral/answers/229835-is-the-mathworks-folder-necessary-to-run-properly?requestedDomain=www.mathworks.com).
So, yes. It seems like you can delete the folder.
Or just move it to MathWorks.bak and check if Mathworks still works properly. In case everything is working fine, you can delete MathWorks.bak.
A program can do anything when run as sudo and depends only on what the program is designed to do. sudo simply elevates the permissions when running a given command.
I would have thought that the installer would have downloaded everything to /tmp instead of /root/Downloads, but as long as you didn't select /root/Downloads as your installation directory for MATLAB and this is only the temporary download location you can certainly remove it after successfully installing MATLAB to a "typical" location such as /usr/local/MATLAB/R2016a.

phpstorm write issues in ./idea directory

When I try to save a file to disc within a project directory, I get this error:
java.io.IOException: W:\\[projectname]\\.idea not found
Some research tells me, the (network) location is not writable.
I'm trying to write this file from phpstorm in windows 8.
The drive (W:) is a network drive to a linux machine.
The directory I try to write to is chowned to the same user and group as I connect with in windows.
This is a result of ls -alh:
drwxrwxrwx 2 correct-user correct-user
On Linux and other Unix-like operating systems files starting with a . are considered 'hidden files' by default. As such, when the Windows-based program creates it, it suddenly doesn't see it anymore right after since it's hidden, even though the creation was successful. You can fix this in your Samba config by adding the following line to the share configuration:
hide dot files = no
In my samba settings I added a veto files parameter. Removing this parameter allows me to write dot files again.
Samba describes this setting as follows:
This is a list of files and directories that are neither visible nor accessible

Timthumb and tmp folder

Recently a web space ran out of space. Now I found out that the tmp folder outside the home directory was full of these files: timthumb_tmpimg_00BZyC. Some of these files can't be opened. Why is timthumb storing files outside the home directory? The tmp folder is on the same level like dev, etc, proc, root, sys and so on.
Has the site a security problem? Are some settings incorrect?
Timthumb is used in version 2.8.5 by the Wordpress plugin vSlider. The site also uses Simple Post Thumbnails which uses Timthumb in v. 2.7. I replaced both with Timthumb 2.8.10.
Or does it have to do with temporary files created by timthumb, which were never deleted?
/tmp is intended to be world-writeable -- though if you try the following:
ls -l / | grep tmp
you'll see that it has the sticky (t) bit on, meaning that files created by a user can only be deleted by the same user or a superuser, to prevent different users from clobbering each other's temporary files. This is similar to the %SYSTEMDIR%\TEMP directory in Windows.
So it's not a security problem on the Linux side, though it could be a misconfiguration or a bug on the part of the WordPress plugin you're using. Is there an option limiting how many thumbnails it keeps?

Resources