Forum: Small and simple tricks

Forum huvudsida -> Kommentarer -> Bloggar -> Small and simple tricks

Sidor: 1

Till botten

derfian 01:27 - 5:e Mars 2007 | Post #1
Medlem
Inlägg: 149


Skicka PM

Hey everyone, time for a lession in what you can easily do with a modern desktop environment!

There are times when you want to quickly upload a file to your web server so that others may view it. Images, pieces of code, you name it. But, in order to do this, you had to either navigate first to the file, and then navigate to the correct directory on the server, and then paste the file, or open a terminal, find the file, write a long scp command (which if you’re lucky has bash-completion set so that it’ll complete filenames over ssh connections).

But fear not, I wrote a small script which ties in to nautilus make these things an easy task. Simply find the file, right-click and choose web-publish (or whatever you’ll name the script - it’s not important).

Here’s the script: http://e101.no-ip.org/~derfian/masamune-publish/web-publish-e101.sh.txt - stick it in ~/.gnome2/nautilus-scripts/, rename it to something sensible, edit it to fit your particular server setup (word to the wise, i’m using ssh keys and an ssh-agent to keep my passphrase in memory, so that it won’t ask me for passwords. i doubt you’ll have a nice dialog window pop up on you if you’re forced to enter the password yourself (although, i could look into it, but I doubt scp will let you specify your password on the command line, and if you were able to, it’s stupid for other reasons - so.. well)).

Right-click a file, choose scripts, and select whatever filename you chose for the file - if you have libnotify, a box with the url to the new file will be shown, allowing you to click the url to launch a webbrowser pointing at that url. kickin’. It looks something like this: http://e101.no-ip.org/~derfian/masamune-publish/Screenie.png

that’s it for now.






Independence 11:58 - 5:e Mars 2007 | Post #2
Administratör
Inlägg: 1800


Skicka PM
Sådär, nu har jag fixat med ssh-agent också så det blir både trevligt och säkert Smiley
Tackar för scriptet, det är riktigt smidigt. Ska bara komma ihåg att använda det också Smiley

-------------------------

Vi är riddarna som säger fiskbulle!





Sidor: 1

Forum huvudsida -> Kommentarer -> Bloggar -> Small and simple tricks
Atom feed

Du får inte posta i den här tråden | Till toppen