Tag Info

New answers tagged

1

The #!/bin/bash at the top of the script is useful only to execute it by typing directly it's name : $ ./scriptname That method also requires the file execution permission to be set. Indeed, when you execute a file, either it is written in assembly language, or the interpreter is specified in the file, following the convention #!: ...


5

The Linux kernel itself is mainly written in C with machine specific parts in Assembler (machine boot-up code etc.) For documentation easiest thing to do is have a look into the Documentation folder inside the kernel sources. I don't know your experience with kernel developing but for a start you should have a basic grasp on OS principles, there are good ...


0

unrar p -inul archive.rar will print the content of extracted archive on the screen, but it will concatenate all files: $ unrar p -inul archive.rar content of first file and here is second fle So if you have one file in archive, then you could do this: $ unrar p -inul archive.rar | ssh serverb 'cat > file.from.archive' If you have many files, then ...


0

You could use an awk associative array indexed by the field whose uniqueness you are asserting e.g. for the unique values of the to= field (field $6 when split on commas): $ awk -F, '{split($6,s,"="); arr[s[2]]=s[2]" = "$7","$6;} END{for (id in arr) print arr[id]}' data.txt EGF = toid=164,to=EGF ADRA1A = toid=21,to=ADRA1A ACE = toid=11,to=ACE ADRA1B = ...


0

I think what you're looking for is flashrom. Provided that your system is supported, you can read your BIOS content by issuing # flashrom -r <outputfile> If you only want to save the so called CMOS RAM (those extra-bytes you save configuration to, like alarm on RTC et al) the kernel's nvram driver and device might help you: config NVRAM ...


1

Assuming that the names are in a file called "filename.txt", You can try the following for the first table: cat filename.txt | awk -F "," '{ print $2 " = " $7 "," $6}' | sed -r 's/^.{5}//' For the second table: cat filename.txt | awk -F "," '{ print $2 " = " $3 "," $6}' | sed -r 's/^.{5}//' Good luck! EDIT: For the second table: cat ...


0

First edit this file: $ vim /etc/sysconfig/network-scripts/ifcfg-eth1 Then change ONBOOT to yes: ONBOOT=yes Then restart network, it will works fine.


0

You have a typo in your quote - It should start with "Not recommended is using sh <scriptname", which sends standard input to sh rather than to scriptname.


-3

I'd say, 'Yes, go for it.' If it's not your primary machine/system, you'll have a lot of fun, get very frustrated, learn a lot, and who knows, maybe even produce a new type of Puppy. There can NEVER be too many Puppies!!!


0

You are doing it wrong; very wrong. Do not create any exec scripts. https://wiki.archlinux.org/index.php/openbox#Wallpaper_.2F_background_programs


0

First If by that you mean creating a custom Ubuntu or other distros yes you can and this action is not entirely distro-specific (i.e in your case Redhat). For that you could use two diffrerent approaches. Either use automation tools such as linuxcoe and other different tools or go native and start by LFS (Linux From Scratch). Either way you have three things ...


1

A simple solution would be to have the script periodically check for the directory, and only proceed once it's there: PENDRIVE='/run/media/Username/121C-E137' while [ ! -d "$PENDRIVE" ]; do sleep 10 done cd $PENDRIVE ...


0

The simplest and the most proper variant today is to install a target system as a virtual guest, using any kind of virtualization (from a simple chroot through LXC and up to VirtualBox, VMWare, etc.) and then use distro-specific native tools. You should think of some cross compilation without virtualization under very extreme circumstances.


1

I actually solved this my self. The mistake I was making was creating the wallpaper.sh file in ~/.config/openbox/ I should have only created a file called autostart.sh or autostart (either work for me) inside ~/.config/openbox/ and in that file I simply write feh --bg-scale /home/myusername/Pictures/nameOfPicture.png I then save and close. After ...


3

With ntpdate: ntpdate -d 0.debian.pool.ntp.org Or for the offset only: ntpdate -d 0.debian.pool.ntp.org | sed -n '$s/.*offset //p'


0

Disregard cd, | and &&. You just need to use the absolute(full) path to the CumulusServer file you're trying to execute. Additionally, you can remove the brackets [ ] from the --pidfile option. When showing examples of a program's command line syntax, brackets denote an optional section of the command and they aren't actually used. This will ...


2

All block devices have a removable attribute, among other block device attributes. These attributes can be read from userland in sysfs at /sys/block/DEVICE/ATTRIBUTE, e.g. /sys/block/sdb/removable. You can query this attribute from a udev rule, with ATTR{removable}=="0" or ATTR{removable}=="1". Note that removable (the device keeps existing but may have ...


1

This is a bug somewhere in the kernel. It is not directly related to rootfs/initramfs changes. It may be due to some other change you made (did you use the same sources, the same configuration, the same compiler?), or it may be related to some timing issue that revealed a latent bug. This warning comes from handle_irq_event_percpu and the interrupt handler ...


1

The Linux kernel contains data structures whose layout varies not only from version to version but also depending on the compilation options. As a consequence, when you compile a kernel module, you need to have not only the header files from the kernel source, but also some header files that are generated during the kernel compilation. Merely unpacking the ...


0

This is due to a recent gnome-terminal change. Recent gnome-terminal no longer accepts the --disable-factory argument. Install the xterm package, then in a gnome-terminal session do the following: $ unset GNOME_DESKTOP_SESSION_ID $ monodevelop This will cause monodevelop to use xterm as its external terminal and all should be well.


0

Procmail can be used to do this, but will need and Envlope-to header added by the MDA. It may be simpler to setup virtual domain aliases in the mail server. Exim4 supports different aliases for different domains, but needs some setup to do so. I would expect this capability from Postfix and Sendmail as well, although I haven't multiple domains with ...


1

If you don't mind this command being the last thing to run at boot time, drop it into /etc/rc.local. Note that rc.local usually contains a statement like exit 0, make sure to add your command before it so it actually runs. For more sophisticated actions and to allow this daemon to be stopped/(re)started manually after boot, you will want to add this ...


0

I don't know exactly what you unpacked in /usr/linux-lts-raring-3.8.0, but: It's probably not what you need. The location is really weird, you shouldn't be creating directories directly under /usr. To compile a kernel module, what you need is the headers plus a few more files produced by compiling the kernel with the same configuration. See unable to ...


1

With a little effort I found the answer to my second question: cat /sys/block/sda/removable


1

Once someone has physical access to the system, there is little you can do. Your best bet would be something like TrueCrypt on all your hard drives, and as we'll as removing the CD and floppy drives as stated in an above answer, hot glue over the SATA/IDE connectors to prevent anyone plugging a CD drive in . Set a really good password on BIOS/ UEFI and turn ...


1

Where did you download the 2.6.32 kernel? If you use CentOS then just install sources of your kernel 2.6.32-431.11.2.el6.x86_64 from CentOS repository, since RedHat uses patched kernel. Please also make sure that configuration of the kernel source tree you build against is exactly the same as of running kernel. Usually there are config-* files at /boot/ ...


0

No, kernel compiling does not take “few hours”. Linus Torvalds said that it took him 12 minutes in the old days, and a lot less these days. Of course it depends whether you're compiling a kernel with just the drivers you need for your hardware, or a distribution kernel with all the drivers people may need — but even for a distribution kernel on a slightly ...


0

Doing several copies in parallel is rarely useful: whether the limiting factor is network bandwidth or disk bandwidth, you'll end up with N parallel streams, each going at 1/N times the speed. On the other hand, when you're copying from or to multiple sources (here B and C), then there is an advantage to doing the copies in parallel if the bottleneck is in ...


0

I am having the exact same fan problem on my Asus X75A. It would appear to be a hardware bug on a number of Asus laptops as reported here: https://bugs.launchpad.net/ubuntu/+source/upower/+bug/1088146 The short workaround: Turn off the laptop, remove the battery for a few seconds, re-assemble and turn back on. This bug would appear to go hand in hand with ...


0

Maybe the udev environment that executes those scripts has no PATH defined. Try to use full paths to cd, mkdir, cp etc. commands. You can find out the paths using for example with which cd command in shell.


0

bash: compress: command not found This means the command compress is not installed or known to bash. you need to install it with your package manager ( try sudo apt-get install compress) or use other common tools such as bzip2 zip bzip2 example also see


0

How completely do you want to block console access? If it is just for when the system is up and running then you can simply disable getty from running. Look at /etc/init/console.conf and /etc/init/tty?.conf. If you want to make sure that nobody reboots into a live cd then your best bet is to epoxy the USB ports and remove the cd drive from the system.


0

I usually have mine as /c, /d etc mimicking the drive letters Windows uses for them. I tend to have several hard disks and partitions, and this helps me keep track of them.


0

You can do multiple things in parallel by using background processes. As a general example: rsync foo machine1: & rsync bar machine2: & rsync baz machine3: & wait The wait ensures that the program does not progress beyond that point before all the background processes created by the script are finished. The & goes at the very end of each ...


3

I'm not sure (it has been a while) but it looks to me that is a reference to the old Linux routine (1992): ftp://ftp2.de.freebsd.org/pub/linux/tsx-11/sources/usr.bin/doshell.c: #include <stdio.h> #include <sys/file.h> #include <errno.h> extern char *sys_errlist[]; main(int argc, char *argv[]) { if (argc != 3) { fprintf(stderr, ...


1

I've filed a report and indeed it is confirmed as a bug. Found this workaround: On the computer running Wheezy: $ sudo dumpkeys -l > mykeys.txt On the computer running Jessie, I've added this to /etc/rc.local: loadkeys /path/to/mykeys.txt


1

This error: error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied) ... would appear to be you trying to perform an rpm -ivh ... command as a user other than root. You'll need to run it like so: $ sudo rpm -ivh yum.3.2.0-40-el6.centos.noarch.rpm Also make sure that you're in the directory where you happened to download ...


1

The Linux kernel contains data structures whose layout varies not only from version to version but also depending on the compilation options. As a consequence, when you compile a kernel module, you need to have not only the header files from the kernel source, but also some header files that are generated during the kernel compilation. Merely unpacking the ...


0

Use a bigger block size. Are you maybe confusing sync/async IO with direct/buffered IO?


1

I am a Fedora user and hence I am going to recommend it. The default Fedora desktop ISO is a Live image with GNOME 3 as the DE. But you have a number of other choices.


0

I am not sure I correctly understand your situation, but cat /dev/input/event0 | someprogram should make someprogram read from standard input, whatever is written to /dev/input/event0. (May I ask how you where able to make the IR receiver write to a device file. That is something I failed to accomplish with my IR dongle.) My general advice is to read ...


0

Have you considered using logrotate? Logrotate is a utility for rotating log files out at scheduled intervals. After installing it, you would configure it with sections that look like this: /var/log/*.log /var/log/auth /var/log/messages { daily rotate 5 copytruncate compress dateext } When you installed it, your package manager should have already ...


2

/sys is a special filesystem. You can't just create it and put files in it. It's like /proc, a fake filesystem provided by the kernel. Geting /sys working requires 2 things: In your kernel configuration, you need to have CONFIG_SYSFS=y. You need to mount it with mount -t sysfs none /sys (assuming you're running from an initramfs since you mention cpio). ...


0

You could always review it's source code for yourself, and you would see under no condition does it ever perform the actual ls command nor display directories. https://github.com/mtoyoda/sl The source is rather simple actually. Even if you are "not a coder" you should still be able to understand most of it. I believe the "bug" you posted above is really ...


2

An easy way to do this, if it meets your needs, would be to have a specific log file that gets rotated everyday. First you add to /etc/(r)syslog.conf, probably near the top in case there are any rules that discard something after logging it: *.* -/var/log/daily.log This will receive all messages; i.e., anything that's in any other log will be ...


0

I'm not 100% familiar with Airdrop but in looking at the Wikipedia page on the topic it essentially sounds like a file sharing (P2P) without having to have an access point in the mix. Basically 2 WiFi clients can share files among each other. To that end there are 2 options listed at the bottom of that same Wikipedia page. Shoutr Wi-Fi Direct The first ...


1

su executes your login shell as indicated in the login database. This is /root/zsh, which doesn't exist, so the command su fails. chsh only accepts changing the shell of a user who currently has a valid shell (listed in /etc/shells). Since /root/zsh is not accepted, chsh fails. The root user can change anyone's shell, but this test is made after the ...


0

Quote from http://superuser.com/questions/72226/linux-live-cd-for-distributed-computing-projects Dotsch/UX is one. Dotsch/UX - A USB/Diskless/Harddisk BOINC Ubuntu Linux Distribution The purpose is to make a Linux distribution for BOINC which easily installs and boot from a USB stick, hard disk and from diskless clients ...


0

You must skip the first line: awk 'BEGIN { FS=":" printf "%-10s %-35s %-55s\n", "RANK", "PERFORMER","SONG" print "=====================================================================\n"} FNR==1{next}{printf "%-10s %-35s %-55s\n", $1, $3, $2}' songs If you don't mind the order of output, try: $ awk -F':' 'FNR==1{next}{a[$5]+=1} END{for(i in a){print ...


6

The simplest method I know to list all of your interfaces is ifconfig -a EDIT If you're on a system where that has been made obsolete, you can use ip link show



Top 50 recent answers are included