zeldor.biz

Linux, programming and more

Copyright © 2025
Log in

Dropbox KDE integration

November 28, 2010 by Igor Drobot Leave a Comment

After working some time with Dropbox I wrote this little python script to make my work with Dropbox more efficient and faster.

With a right click I can Upload my file to my Dropbox account:

Right Click

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env python
# -*- coding:utf-8 -*-
 
import os, sys
 
PUBDIR = '/home/id/Dropbox/Public/'
USERID = 156881168
 
if len(sys.argv) > 1 and os.path.isfile(sys.argv[1]):
 os.popen('cp -f %s %s' % (sys.argv[1], PUBDIR))
 dest = 'https://dl.getdropbox.com/u/%s/%s' % (USERID, sys.argv[1].split('/')[-1])
 os.popen('kdialog --msgbox "Link was copied to the clipboard:\n%s"' % dest)
 os.system('dbus-send --print-reply --dest=org.kde.klipper \
    /klipper org.kde.klipper.klipper.setClipboardContents string:"%s"' % dest)
else:
 os.popen('kdialog --error "Please choose file!"')

#!/usr/bin/env python # -*- coding:utf-8 -*- import os, sys PUBDIR = '/home/id/Dropbox/Public/' USERID = 156881168 if len(sys.argv) > 1 and os.path.isfile(sys.argv[1]): os.popen('cp -f %s %s' % (sys.argv[1], PUBDIR)) dest = 'https://dl.getdropbox.com/u/%s/%s' % (USERID, sys.argv[1].split('/')[-1]) os.popen('kdialog --msgbox "Link was copied to the clipboard:\n%s"' % dest) os.system('dbus-send --print-reply --dest=org.kde.klipper \ /klipper org.kde.klipper.klipper.setClipboardContents string:"%s"' % dest) else: os.popen('kdialog --error "Please choose file!"')

Add a menu entry for right click:

1
2
3
4
5
6
7
8
9
10
11
12
13
vim /usr/share/kde4/services/ServiceMenus/dropbox.desktop
cat /usr/share/kde4/services/ServiceMenus/dropbox.desktop
 
[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin,all/allfiles
Actions=DropboxURL
X-KDE-Priority=TopLevel
 
[Desktop Action DropboxURL]
Name=Share on DropBox
Icon=/home/id/Pictures/dropbox.png
Exec=/home/id/drop_IT.py "%u" %d

vim /usr/share/kde4/services/ServiceMenus/dropbox.desktop cat /usr/share/kde4/services/ServiceMenus/dropbox.desktop [Desktop Entry] Type=Service ServiceTypes=KonqPopupMenu/Plugin,all/allfiles Actions=DropboxURL X-KDE-Priority=TopLevel [Desktop Action DropboxURL] Name=Share on DropBox Icon=/home/id/Pictures/dropbox.png Exec=/home/id/drop_IT.py "%u" %d

Update:
If you want to make it work only for special users on the system, put dropbox.desktop in your home directory: “~/.kde/share/kde4/services/ServiceMenus”

Another bash based script:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash
 
DROPDIR=/home/id/Dropbox/Public/
USERID=156881168
 
if [ -e "$1" ]
then
        cp -f "$1" "$DROPDIR"
        file=`basename "$1"`
        link="http://dl.getdropbox.com/u/$USERID/$file"
        notify-send -i go-down "Dropbox" "Link to \"$file\" was copied to the clipboard"
        echo "$link" | xsel -bi
else
        notify-send -i go-down "Dropbox" "Please choose file!!"
fi

#!/bin/bash DROPDIR=/home/id/Dropbox/Public/ USERID=156881168 if [ -e "$1" ] then cp -f "$1" "$DROPDIR" file=`basename "$1"` link="http://dl.getdropbox.com/u/$USERID/$file" notify-send -i go-down "Dropbox" "Link to \"$file\" was copied to the clipboard" echo "$link" | xsel -bi else notify-send -i go-down "Dropbox" "Please choose file!!" fi

Icon — Could be a pretty icon (16×16) Icon Dropbox Upload
Exec — path to you *.py script

Filed Under: Bash, Linux

Backup WordPress to Dropbox

November 27, 2010 by Igor Drobot Leave a Comment

And I’m still fascinating of the Dropbox service. I found another useful plugin for WordPress wpTimeMachine that makes Backuping easy for you. It makes a backup to your existing Dropbox account.

This plugin can perform an automatic backup of your Word Press MySQL-database your themes, plug-ins and all the other files and images that you may uploaded to your Word Press folder.
[Read more…]

Filed Under: Linux Tagged With: backup wordpress, Dropbox, Wordpress

Dropbox

November 26, 2010 by Igor Drobot Leave a Comment

Some days ago I found a new useful service for me – Dropbox

Dropbox is a online service that allows you to sync your files online and across your all computers automatically.
For example to share my work progress over the internet to you home work-pc.

Benefits:
* File-Syncing between multiple computers
* Intuitive usage
* Cross platform support and usage – Windows, Linux and Mac
* No complicated interface – runs in the background and access via your regular file browser.
* Access from anywhere where you have internet
* Share your files with other users/pc’s
* Show photos to friends in a gallery

[Read more…]

Filed Under: Linux, Windows Tagged With: Dropbox, dropbox linux, share files

Nagios3 with Lighttpd

November 24, 2010 by Igor Drobot 6 Comments

Why I do it?
Cause my Nagios3 is running as a virtual machine on a Xen Server, and I have less than 64MB of RAM.

First I install lighttpd, to prevent automatically apache2 installation during the nagios3 installation:

1
apt-get install lighttpd

apt-get install lighttpd

[Read more…]

Filed Under: Debian, Linux, Networking Tagged With: Lighttpd, Lighttpd and Nagios3, Lighttpd with Nagios3, Nagios3

Introduction to LVM

November 21, 2010 by Igor Drobot Leave a Comment

hdd

physical volumes:
These are your physical disks, or disk partitions, such as /dev/hda or /dev/hdb1. These are what you’d be used to using when mounting/unmounting things. Using LVM we can combine multiple physical volumes into volume groups.

volume groups:
A volume group is comprised of real physical volumes, and is the storage used to create logical volumes which you can create/resize/remove and use. You can consider a volume group as a “virtual partition” which is comprised of an arbitary number of physical volumes.

logical volumes:
These are the volumes that you’ll ultimately end up mounting upon your system. They can be added, removed, and resized on the fly. Since these are contained in the volume groups they can be bigger than any single physical volume you might have. (ie. 4x5Gb drives can be combined into one 20Gb volume group, and you can then create two 10Gb logical volumes.)

apt-get update && apt-get install lvm2

apt-get update && apt-get install lvm2

pvcreate /dev/md0

pvcreate /dev/md0

Once we’ve initialised the partitions, or drives, we will create a volume group which is built up of them:

vgcreate storm /dev/md0

vgcreate storm /dev/md0

If you’ve done this correctly you’ll be able to see it included in the output of:

vgscan

vgscan

Create your first logical volume:

lvcreate -n data --size 300g storm

lvcreate -n data --size 300g storm

Your new logical volume will be accessible via:

/dev/storm/data
# or
/dev/mapper/storm-data

/dev/storm/data # or /dev/mapper/storm-data

Create file system:

mkfs.ext4 /dev/storm/data

mkfs.ext4 /dev/storm/data

Show created volumes and their sizes:

lvdisplay

lvdisplay

Extend volume:

lvextend -L+10g /dev/storm/data

lvextend -L+10g /dev/storm/data

After resizing you should resize the filesystem:

e2fsck -f /dev/storm/data 
resize2fs /dev/storm/data

e2fsck -f /dev/storm/data resize2fs /dev/storm/data

Remove volume:

lvremove /dev/storm/data

lvremove /dev/storm/data

If you need some visual help you can use: “system-config-lvm” utility co configure LVM.

LVM Stripe

First thing to say it’s a kind of RAID0; if you have the need of a single big partition but you have only multiple smaller disks, you have the possibility to crate a LVM-stripe over all your smaller disks.
In this example I have 4x 4TiB devices which will be used to create a single one with 16TiB

pvcreate /dev/sdb /dev/sdc /dev/sde /dev/sdd
# verify with:
vgdisplay to verify

pvcreate /dev/sdb /dev/sdc /dev/sde /dev/sdd # verify with: vgdisplay to verify

lvcreate -l 100%FREE -n storage backups
# to verify:
lvdisplay

lvcreate -l 100%FREE -n storage backups # to verify: lvdisplay

Create a filesystem on your 16TiB device:

mkfs.xfs -L storage /dev/mapper/storage-bacula

mkfs.xfs -L storage /dev/mapper/storage-bacula

Filed Under: Debian, Ubuntu Tagged With: disk, LVM, LVM Stripe, partition, volume

  • « Previous Page
  • 1
  • …
  • 49
  • 50
  • 51
  • 52
  • 53
  • …
  • 62
  • Next Page »
Yeaaah Cookie! We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok