Is there a system variable that stores the location of a user's Dropbox? - linux

At least in the linux version of Dropbox, the user can choose which folder becomes their Dropbox. Is there a simple way to get this programmatically?

Maybe this will give you a clue. http://wiki.dropbox.com/TipsAndTricks/TextBasedLinuxInstall

The Dropbox configuration is stored in a sqlite database in your ~/.dropbox folder.
I found a small script which edits the Dropbox folder location:
http://dl.dropboxusercontent.com/u/119154/permalink/dropboxdir.py
http://cmdlinetips.com/2012/05/how-to-change-dropboxs-default-directory-location/
The most forward way to force Dropbox to use another folder location is a symbolic link.
Stop the dropbox daemon and simply replace the default folder with a symlink:
> mv ~/Dropbox /other/dropbox/folder
> ln -s /other/dropbox/folder ~/Dropbox

Related

How to install minishift in a customized directory in linux

While trying to start minishift, it automatically updates the cache in the home directory.
/home/abc/.minishift/cache/.....
However I want minishift to use a custom directory instead of the default home directory as I am running out of space
Can this be achieved by changing any parameters during ./minishift start
Tried codeready containers too, but it copies in the default home directory..
FATA Failed to copy embedded 'crc_libvirt_4.5.1.crcbundle' from /opt/data/crc-linux-1.13.0-amd64/crc to /home/abc/.crc/cache/crc_libvirt_4.5.1.crcbundle: write /home/abc/.crc/cache/crc_libvirt_4.5.1.crcbundle: no space left on device
I found the answer to this :
export MINISHIFT_HOME=/opt/softwares/
echo 'export MINISHIFT_HOME=/opt/softwares/' >> ~/.bashrc
This helped in solving the redirecting the installation from home to customized directory.
Similar for crc installation as well.
As noted, you should use Code Ready Containers (CRC) and not minishift. This is a known issue and is being tracked here: code-ready/crc/issues/817.
The current workaround seems to be to create the directory where you want it to be and then create a symlink to ~/.crc:
mkdir -p /opt/crc
ln -s /opt/crc/ ~/.crc

windows 10 - permission denied when trying to delete folder

I have a certain folder on my computer that I want to delete but I can't. I opened the cmd console as administrator and tried to delete the folder, but access was denied. It doesn't even let me change ownership on the folder. I'm using windows 10 64-bit. How can I delete the folder?
Thanks.
Try Lock Hunter , its a unlocker software which worked well for me
open power shell as administrator
cd c:\folderInQuestion
rm -r .\folderInQuestion\
If the folder lies outide of your specific User Account folder, then you will have to take ownership of the folder (or a parent folder) before you can delete it.
In my case, I needed to delete a subfolder that was nested deep inside my Projects folder, which sits at my root. Even though my account had "full control" (see this)
To take ownership of the folder, follow this: https://answers.microsoft.com/en-us/windows/forum/windows_10-files/give-permissions-to-files-and-folders-in-windows/78ee562c-a21f-4a32-8691-73aac1415373

OpenShift WordPress Theme Developer workflow

I create a application with Cartridges,
PHP 5.4
MySQL 5.5
phpMyAdmin 4.0
I commit my WP file, plugin and themes into GIT.
In my .gitignore, i added
wp-content/uploads
I did go through the book "Getting Started with OpenShift", as the book chapter 8 said
“The other directory available to you is the OpenShift data directory,
which is currently at $OPENSHIFT_HOMEDIR/app-root/data. We use the
environment variable OPENSHIFT_DATA_DIR to point to this location. ”
“The data directory is where your application should store its files
and put configuration settings, download themes, or generally anything
you want to survive restarts and Git pushes.”
Excerpt From: Steven Pousty and Katie J. Miller. “Getting Started With OpenShift.”
I access to SSH. When I upload my media in WordPress, It is store inside
$OPENSHIFT_REPO_DIR/php/wp-content/uploads/2014/05/1.jpg
1.How do I pointed it to?
$OPENSHIFT_DATA_DIR/uploads
If that is the case, in my .openshift/action_hooks/deploy file, I had added this script
if [ ! -d ${OPENSHIFT_DATA_DIR}uploads ]; then
mkdir ${OPENSHIFT_DATA_DIR}uploads
fi
ln -sf ${OPENSHIFT_DATA_DIR}uploads ${OPENSHIFT_REPO_DIR}php/wp-content/
However, the soft link script does not did it job, during my GIT PUSH, it shows the following error.
remote: ln: target `/var/lib/openshift/[ID]/app-root/runtime/repo/php/wp-content/' is not a directory: No such file or directory
my guess is, the $OPENSHIFT_REPO_DIR/php/wp-content/uploads/2014/05/1.jpg , the uploads folder already removed before the script do it job.
How do I keep the uploads folder content in such a situation. OpenShift expert kindly help in this matter.
After I had few attempt of the build script, I finally found out what is my problem.
To answer my own questions
How do I point it.
Create a symlink. During the GIT push, it will definitely delete your uploads folder ($OPENSHIFT_REPO_DIR/wp-content/uploads/).
This is the code you should use, just remove the php folder after the repo.
if [ ! -d ${OPENSHIFT_DATA_DIR}uploads ]; then
mkdir ${OPENSHIFT_DATA_DIR}uploads
fi
ln -sf ${OPENSHIFT_DATA_DIR}uploads ${OPENSHIFT_REPO_DIR}wp-content/
I hope it's help.
This file has plenty of examples
https://github.com/openshift/wordpress-example/blob/master/.openshift/action_hooks/deploy
The problem is that with every git push we are going to overwrite that directory.
I think a better idea is with every build rsync contents from your repo over to the data directory where it expects to find the themes (rather than doing the symlink)

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?

two folders in sync - one is updated with the CVS

I have copied a folder say "folder" which is maintained in CVS as folder_backup.
$cp -af folder folder_backup
Frequently I cvs update "folder" and I want folder_backup to be in sync with folder.
Is there a automatic way to sync both folder and folder_backup whenever folder is cvs updated.
Both are in the same machine.
Well if you mean that 2 directories are on the same machine but not on the same drive, you'll need hard copy.
If only need to do backup from local CVS workdir into the backup directory, you need a unidrectional syncing tool. Rsync is one of them and easy to use. AFAI remember something as simple as rsync dir_from dir_to will to the trick.
If you mean that you want to be able to modify either of that 2 workdirs and you want to merge those 2 directories once in a while, you'll need a bidirectional syncing tool: Unison is one of them. I think it is quite hard to configure for the merge option, but it is worth the cost . See wikipeda page to compare syncing tools
If the folders are on the same system the best option is to link folder.
ln -s path/to/folder_backup/ folder

Resources