usb-drive

Upstart calling script (for inserted USB-drive)

爱⌒轻易说出口 提交于 2019-12-02 19:42:57
I know that Ubuntu (and Fedora) uses Upstart istead of the classical System V init daemon (SysVinit). I would like to know how to detect when a USB-drive has been inserted, mount it and copy some files to it. I would like Upstart to call my own script for this. If it is possible I would like Upstart to call the script for a specific USB-drive, so that I would get normal functionality for every USB-drive except my "instant backup" USB-drive. If Upstart could send the USB-drive identification string as an argument to my script I guess that would be the ideal solution, as I would be able to have

Differentiating between data card and pen drive or USB flash drive

空扰寡人 提交于 2019-12-02 01:30:30
问题 I am having a Vodaphone data card which can be inserted in a USB port. I have XP and Vista OS, and I am using WM_DEVICECHANGE event of Windows, to know USB Insertion and removal, and it's working fine for me. But I am not able to differentiate between Data card insertion and Pen drive insertion. Is it possible? 回答1: Yes. The "pen drive" and "data card" implement different interfaces. You will have subscribed using RegisterDeviceNotification for DEV_BROADCAST_DEVICEINTERFACE . The LPARAM of

Differentiating between data card and pen drive or USB flash drive

泄露秘密 提交于 2019-12-01 21:03:13
I am having a Vodaphone data card which can be inserted in a USB port. I have XP and Vista OS, and I am using WM_DEVICECHANGE event of Windows, to know USB Insertion and removal, and it's working fine for me. But I am not able to differentiate between Data card insertion and Pen drive insertion. Is it possible? Yes. The "pen drive" and "data card" implement different interfaces. You will have subscribed using RegisterDeviceNotification for DEV_BROADCAST_DEVICEINTERFACE . The LPARAM of the WM_DEVICECHANGE you get back will then be a DEV_BROADCAST_DEVICEINTERFACE* . This structure has a dbcc

Autorun removable drive

大城市里の小女人 提交于 2019-12-01 02:00:02
Autorun was disabled in Windows. I am looking for an alternative. I got this AutoIt script : $DBT_DEVICEARRIVAL = "0x00008000" $WM_DEVICECHANGE = 0x0219 GUICreate("") GUIRegisterMsg($WM_DEVICECHANGE , "MyFunc") Func MyFunc($hWndGUI, $MsgID, $WParam, $LParam) If $WParam == $DBT_DEVICEARRIVAL Then MsgBox(4096, "Info", "My Drive has been Inserted, Backup My Files!") EndIf EndFunc While 1 $GuiMsg = GUIGetMsg() WEnd Soon as plugged in, the message box appeared. Now, to run a file I replaced MsgBox(4096, "Info", "My Drive has been Inserted, Backup My Files!") by Run ("F:\path\to\my\file.cmd") But

How Do I Eject a Volume in Java?

痞子三分冷 提交于 2019-11-30 23:34:28
How can I "eject" a volume with Java, cross platform? I have a program that does some operations on a removable drive (USB memory card reader), and once it's done, I want the program to eject/unmount/remove (depending which os lingo we're talking in) the memory card. Is there a reliable cross-platform method of doing this? Probably isn't the answer you're looking for, but... No. To my knowledge, there isn't an established single-platform way of doing this. For that matter, I've never come across a Java way of doing this. A rather scary C# CodeProject does allow ejecting devices, but only on

How Do I Eject a Volume in Java?

时间秒杀一切 提交于 2019-11-30 17:50:42
问题 How can I "eject" a volume with Java, cross platform? I have a program that does some operations on a removable drive (USB memory card reader), and once it's done, I want the program to eject/unmount/remove (depending which os lingo we're talking in) the memory card. Is there a reliable cross-platform method of doing this? 回答1: Probably isn't the answer you're looking for, but... No. To my knowledge, there isn't an established single-platform way of doing this. For that matter, I've never

Python portable, linux & windows

点点圈 提交于 2019-11-30 14:53:17
I am using linux at home but at school we use windows 7. I want to have python installed on my usb to that I can use it for both windows and linux (ubuntu 13.04). Is there a way that I can install python on my usb so that both win and linux computers can use it? I am more interest in python 2.7. I have Wine installed on my linux machine. It might no be ideal but could I use portable python and run it under wine? You can install two python's. Download Anaconda from http://continuum.io/ website for linux and windows. Install them (on win and lin machines) and then create two environments on your

How to use USB drive as remote

為{幸葍}努か 提交于 2019-11-30 13:49:38
问题 I have local copies of a GitHub repo on Laptop and Desktop. The Desktop is ahead of the Laptop and the remote GitHub origin . I want to pull changes onto the Laptop, but don't want to push to the public origin . How do I set up a USB stick/external HDD as a remote? 回答1: Plug the USB drive into Desktop, and assuming it's showing up as J: Initialise a bare repo that will act as the remote: git init --bare J:\repo_name cd to the local repo and: git remote add usb J:\repo_name git checkout master

Installing the Android USB Driver in Windows 7 [closed]

做~自己de王妃 提交于 2019-11-30 08:21:25
I am attempting to install the Android USB Driver in my computer running on Windows 7. I followed the instructions in the developer section of the website, but I am stuck. Here is the website with the instructions; http://developer.android.com/tools/extras/oem-usb.html#Win7 What I am having trouble with is in step 7-8, when I click next after selecting the path <sdk>/extras/google/usb_driver under where I enter the location. I get an error message that says "Windows could not find driver software for your device" I have tried looking for help in the Developers website, but it's so difficult to

OK Programming language from USB stick with no installation

守給你的承諾、 提交于 2019-11-30 05:14:28
I'm looking for a compiler or interpreter for a language with basic math support and File IO which can be executed directly from a memorystick in either Linux or Windows. Built in functionality for basic datastructures and sorting/searching would be a plus. (I've read about movable python, but it only supports windows) Thank you Not sure what are the issues there for the other languages, but I am pretty sure that Lua will work fine on such environment. It is perfect for your requirements: basic I/O, math functions, excellent data structures (all based on numeric and associative array, with any