Tag Info

Hot answers tagged

123

/dev/null is a file. A special file. A device file like /dev/sda or /dev/tty that talks to a piece of hardware on your system. The only difference with /dev/null is that no hardware is linked to it. Any data you send to it is silently discarded. Like the following command: $ echo "Hello World" > /dev/null which won't print anything on your terminal ...


27

@Benoit is nearly correct in his answer. You will also need to fix permissions. $ sudo rm /dev/null $ sudo mknod /dev/null c 1 3 $ ls -l /dev/null crw-r--r-- 1 root root 1, 3 Mar 18 08:38 /dev/null $ sudo chmod 666 /dev/null $ ls -l /dev/null crw-rw-rw- 1 root root 1, 3 Mar 18 08:38 /dev/null This restores the permissions. Otherwise, as a non-root user ...


14

There is a big difference between overwriting a file and writing to a file. When you write something to /dev/null, e.g., $ echo Hello > /dev/null ...it gets silently discarded. For this you need write permissions to /dev/null, which everyone has: $ ls -l /dev/null crw-rw-rw- 1 root root 1, 3 Mar 18 13:17 /dev/null When you overwrite /dev/null, as ...


14

I never did that but I think you need to create a keymap file in /lib/udev/keymaps/ and add a rule for your device to /lib/udev/rules.d/95-keymap.rules Details: An udev keymap maps scan codes to key codes, so you need to find both to create the keymap file. To find the scan codes run the following and press the buttons on the device: sudo ...


13

Unfortunately there seems to be no easy way. What I will describe is how to create a new Upstart job to set the values on boot through the virtual filesystem under /sys. Find the device path of your trackpoint Run the following in a gnome-terminal (press Alt + F2, type gnome-terminal, and hit Enter): find /sys/devices/platform/i8042 -name name | xargs ...


11

I don't know if this helps in reloading the network configuration, but when I modified /etc/udev/rules.d/70-persistent-cd.rules to correct the DVD device link from /dev/dvd1 to /dev/dvd, I had to run sudo udevadm trigger to get have the new links created.


10

In Ubuntu 12.04 (Unity, and presumably Gnome Shell/Classic) automounting is handled by GNOME Desktop/Nautilus, which monitors DBus events for insertion, etc. The gvfs* backend is used, in co-operation with udisks for the low-level mounting, etc. gvfs-mount is used internally, and running it in monitor mode with the -o switch will show, for example: $ ...


8

I guess your usb drive is formatted with VFAT/FAT32. This file format does not support execute permissions which is why chmod +x fails. [Edit] Ok, had a bit of a play and search on the net. Lots of 'solutions' suggest that you should change /etc/fstab. This just seems clunky to me, what do you do? change fstab every time you encounter a new usb flash ...


8

Maybe you should specify which part of the process is interesting to you but let's say a USB stick is added then... kernel detects and initializes the device (see dmesg), then exports all the information it has found via a directory in /sys (see /sys/devices) kernel sends a uevent signal which is picked up by udev daemon udev daemon gathers available info ...


8

When you run the command $ sudo mv test_file /dev/null you have replaced the special file /dev/null with your text file. Subsequent attempts to read from /dev/null return the contents of your text file, and programs that attempt to use /dev/null in the normal way will probably break. Replacing or deleting device files in /dev/ requires superuser ...


7

You have to combine all the advice given here in the right order: Bring down the network service networking stop Unload the driver module from the kernel Find the name of the module lspci -v and look for "Kernel driver in use:" modprobe -r <driver module> Reload the udev rules udevadm control --reload-rules Trigger the new rules udevadm trigger ...


7

I bought the exact same model (900X4C) a couple of days ago and I've successfully seen the F9/F10 keys work, and I didn't even had to install the Voria / samsung-tools package either - I just fiddled around with the /lib/udev/keymaps/samsung-other file and the corresponding force-release file. Unfortunately, I messed up the install process (I wasn't running ...


6

It looks like you have two problems. The first is an ordering problem. Reading the kernel.org manpage on udev, it mentions: All rules files are ... processed in lexical order Meaning rules are processed in alphabetical order. The first rule that triggers for a device creates the device file. It looks like you've named your rule file ...


6

This tutorial explain very nice how to do what you want: Creating Custom Symlinks to Devices According to it, there are two approaches to creating symlinks. The first one is to use the model name and the serial number: SUBSYSTEM=="block", ENV{ID_MODEL}=="...", ENV{ID_SERIAL}=="...", ENV{GENERATED}="1", SYMLINK+="dvd" This way, the symlink will stay ...


6

is there any way I can write a udev rule that fixes the name of each adapter based on which physical port on the hub the adapter is plugged into? Yes there is, as it turns out. Consider the last portion of the device hierarchy shown in the second example above: looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb1/1-4/1-4.5': ...


6

In RUN you must to put a path to a script. See man udev: Add a program to the list of programs to be executed for a specific device. This can only be used for very short running tasks. Running an event process for a long period of time may block all further events for this or a dependent device. Long running tasks ...


6

To answer your question of what you should have done, to remove a file, you do: rm test_file As others have stated, /dev/null is a destination for the output of programs.


5

Normally, this is done by adding to /etc/udev/rules.d a file maybe named 50-usb-scale.conf with contents like this: SUBSYSTEM=="usb", ATTR{idVendor}=="HEX1", ATTR{idProduct}=="HEX2", MODE="0666" Where HEX1 and HEX2 are replaced with the vendor and product id respectively. To match on the Interface type instead, you could try replacing ...


5

The usual way to create a Unix domain or TCP socket is programatically, via the mknod or socket system calls. The mknod command will not allow you to create a socket. From the command line, use the socket package If you wish to create a Unix/TCP socket from the command-line, try the socket command from the socket package (install it first). Summarizing ...


4

I finally found a working solution: 1. Find the device path of your trackpoint Run the following in a gnome-terminal (can be opened with Ctrl+Alt+t): find /sys/devices/platform/i8042 -name name | xargs grep -Fl TrackPoint | sed 's/\/input\/input[0-9]*\/name$//' It will return something like /sys/devices/platform/i8042/serio1/serio2 change to whatever ...


4

So I haven't actually been able to set up the fitbit using libfitbit, I had to use my roomates Mac to do the initial setup. As for the "sticking in the stick and get the upload going", I included some udev rules in that package (I believe the original author wrote them), and it should just work when the fitbit is plugged in (once the initial setup has ...


4

Since I don't have your hardware I can't give you an exact answer. I'd suggest that you go to the device in question, for example: ls -l /dev/ttyUSB0 and obtain the major and minor node numbers. Let's say they are 116, 7 Then go to: ls -l /sys/dev/char/116:7 (char, because a tty is a character device, if you were tracing down a disk device you would ...


4

You can write udev-rules to assign different names to the printer, depending on their serial numbers. See http://www.reactivated.net/writing_udev_rules.html#example-printer for an example of a udev printer rule.


4

The bug seems to be fixed now. Without me reporting it. In 12.04 and 12.10 the settings can be found with dconf-editor or dconf in /org/gnome/settings-daemon/peripherals/mouse/middle-button-enabled and persist over standby and reboot.


4

Ok, found this at https://help.ubuntu.com/community/MultimediaKeys When you hit a key on your keyboard, the linux kernel generates a raw scancode for it (if it is assigned). Each scancode can be mapped to a keycode. This is at kernel level. X has a (quasi) total independent way of mapping keys: X reads the kernel keycode table at startup, then ...


3

When checked the vendorId and productId in windows, it shows 1c9e:9e18. But in ubuntu it shows 1c9e:9e08. So tried to switch to same vendorId/productId i.e 1c9e:9e18. For this, create a rule in /etc/usb_modeswitch.d/1c9e:9e08 and put the below contents in the file: DefaultVendor=0x1c9e DefaultProduct=0x9e08 TargetVendor=0x1c9e TargetProduct=0x9e18 ...


3

The problem is the ondrej/systemd ppa. If you expand the package files for precise, you'll see the ppa is providing sysv-rc. Moreover, the main page says the [ppa] follows latest systemd packages as maintained by Debian systemd team. Look at the package details in Debian and you'll see the apt is looking for a Debian-style name; but it's odd that apt is ...


3

The notify-send has trouble putting notifications on a user's screen when called from a script run by root or another user. You should use: output("export DISPLAY=:0; sudo -u {0} notify-send \"{1}\" \"{2}\"".format(user, title, message)) So, use: export DISPLAY=:0 Normally a user is on display :0, but to be sure, you can find which display a user is ...


3

You can try to create the udev rule with the following information (output of udevadm info -a -n /dev/sdb). INFO: looking at parent device '/devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0': KERNELS=="1:0:0:0" SUBSYSTEMS=="scsi" DRIVERS=="sd" ATTRS{rev}=="SSD " ATTRS{type}=="0" ATTRS{scsi_level}=="6" ...


3

If you look at /lib/udev/rules.d/60-keyboard.rules you'll see that everything has been messed around with. This is just part of the udev merger into systemd that has gone on. All hardware rules are compiled into a binary hardware database. These follow a really strange format. The existing rules for keyboards that ship with udev live in ...



Only top voted, non community-wiki answers of a minimum length are eligible