nuked my centos path settings - unix

i, by mistake, nuked my centos path settings by adding a wrong path. i added the following :
PATH=/usr/local/jdk1.6.0/bin
export PATH
to /etc/profile/bashrc and now all the commands are gone.
could someone please help me restore my system.
thanks in advance.

One way of setting your path without breaking it is:
export PATH=/usr/local/jdk1.6.0/bin:$PATH
A short explanation. When you want to add something new to your path, you should keep the old path settings. What you did was to set the path to point only to /usr/local/jdk1.6.0/bin. That's why all the other commands except from the ones found in /usr/local/jdk1.6.0/bin are "gone". Nothing is really "gone". You just need to reset your path. Just open a new shell/terminal instance or simply logout/login and set your path using a more proper way.

export PATH=$PATH:$HOME/bin:/sbin:/usr/bin:/usr/sbin

Related

Typo3 files not found

I have set up a Typo3 project and I am using the Bootstrap Kickstart Package extension. So far everything works, but for example the CSS files are not loaded (see screenshot). If I call the paths in Explorer, all files are available. Can someone here help me?
Do you use the .htaccess of TYPO3? You can find it in the typo3_src folder and move it to your root directory. Without it, the timestamps of the files ?12345 will be interpreted wrong.
Seems it could not get a proper path to the assets. Please check your baseUrl and absRefPrefix
in the setup ts. Check property below:
config.baseURL = http://localhost/project/
config.absRefPrefix = project/
Generally, absRefPrefix required in the local server it does not require at the live server.
Second possibility permission issue, please check directory permission.
Hope this helps you!
Greetings!

Export file from R server to local disk- code

It is possible to copy file form R server to local disc?
I can do this via button (MORE--> Export) but i wanna do this using code.
Anyone can help me?
Screen
I am having same question exactly, and have found a solution
Do you know your R Server's path?
You are able to find full path easily. If you choose an image file in [Files] tab, open the file on the browser maybe.
And then, type this. That's it.
browseURL("http://yourhost:portnumber/files/yourpath/filename.xlsx")

FTP server mysterious behavior - can anyone explain why this happens?

We have an SFTP i.e secure FTP server which is perfectly like and able to login.
Using filezilla i tried to create the following file directly.
Employee_Details_Export_2014-11-03 03:12:11.csv
the FileZilla doesn't create a file and prompt an error message saying -
Filename may not contain any of the following characters:/:*?" <>|
Whereas, the following works fine..
Create a test file
Renamed it as Employee_Details_Export_2014-11-03 03:12:11.csv
Not sure what is happening and what is the issue here?
Please let me know in detail.
Thanks in advance.
As has been suggested, don't use colons. From messing around, however, I'm guessing that you've found an unavoidable bug in Filezilla. The restricted character list are the characters restricted on Windows.
There is not mkfile command, so when you create a new file named "ABC.txt" you'll get something along the lines of:
Command: put "[PATH]\empty_file_yq744zm" "ABC.txt"
Status: local:[PATH]\empty_file_yq744zm => remote:[PATH]/ABC.txt
So what happens is Filezilla creates a file on your local machine, and then uploads it. However, Windows won't let it create a file with a colon, so it fails. However, there is a rename command, and that has nothing to do with the Windows environment. You can also create a directory with a colon without any issues since there is a mkdir command.
Remove the colons in the filename and it should work. You're using invalid characters in your file naming convention.
Employee_Details_Export_2014-11-03_03_12_11.csv
I think this is not related to stackoverflow, but...
this is a conditional on filezilla, not on your server, they added that to the create file
If you would like to fix this you could edit and recompile filezilla,
this is on filezilla code on the file file_utils.cpp

Red filename in Ubuntu CLI (Vagrant)

I am building a FuelPHP application running on an Ubuntu VM powered by Vagrant.
I am trying to include a CSS file on the global wrapper for all my pages, but Firebug tells me it isn't there. (the file path is correct in my <_link rel...>).
The CSS file is actually a compiled from a bunch of LESS files using an app called LiveReload for Mac.
The Apache server on my VM is set to serve from a mounted folder on my Mac, anyone who has used Vagrant should know what I mean by that.
Anyway, LiveReload dumps the CSS file in the correct place, and is populated on my Mac:
However, SSHing into the VM and examining the CSS file leads me to believe that something weird is happening. Firstly, the filename is in red (but it exists!):
Secondly, opening it with a text editor (nano in this case) shows it to be blank, despite it being full on the Mac:
So my question is... wtf is going on here? Why is it showing empty on the VM? Why is it red? Why can't Apache find and serve it?
EDIT, still struggling with this.
I added my own 'test.css' file and it loads that fine. Just not the app.css generated by LiveReload. There's something wrong on the VM. Can anyone help? It's one of those annoying things thats holding up my development.
Here's the stack trace (although i'm sure it has nothing useful in it):
If I guess right than you have a wrong mod rewrite rule which redirects your request to a php script which tries to include a file which does not exists.
So check your .htaccess file
Argh, renamed the file to appcss.css instead of app.css and it works. Changed it back, it doesn't. System musn't like that name for some reason. Annoying the amount of time i wasted, but fixed now!

How can you delete a file in the application directory?

We are writing log files to File.applicationDirectory and want to clean out old log files. The question is how do you delete files out of that directory? When I try and delete old log files out of this directory it gives a security exception. Is there anyway around this?
I know you are not supposed to write to File.applicationDirectory, but we are writting are logs there anyways. So please don't just say don't do that!
Thanks,
Ryan
Another trick, for security workaround
var fileLoc:File= File.applicationDirectory.resolvePath("some.log");
var file:File=new File(fileLoc.nativePath);
fileStream.open(file,FileMode.WRITE);
The second file object can alter the file withot any problem.
File.applicationDirectory is a read only directory.
http://livedocs.adobe.com/flex/3/langref/flash/filesystem/File.html
I found the answer shortly after posting. I was looking in FileTarget of how they write the log file into the application directory and found this gem:
var logFile:File = this._logDirectory.resolvePath(filename);
logFile = new File(logFile.nativePath); // Hack to get around SecurityError if log directory exists within the application directory
So you just specify the full native path and not a relative path from the application directory and you can do whatever you want. Interesting security model!

Resources