Tag Info

Hot answers tagged

6

Don't allow USB access. Truth is that if someone has physical access to the machine, there's not a lot you can do. In this narrow case your best bet is to disable booting to USB and lock the BIOS (or whatever EFI setup utility is being used) with a password. It's a bit like putting a pad lock on a garage door, there are ways around it, but it's an easy ...


6

Clearing the swap is not necessary nor useful. Read linuxatemyram. The kernel has a quite efficient page cache. So RAM is used for useful data (e.g. recently accessed file segment chunks, or heap memory), and less useful data got swapped to the swap zone. Perhaps your swap zone might be too small. You could also swap to some file. See this.


4

To disable the writing of access times, you need to mount the filesystem(s) in question with the noatime option. To mount an already mounted filesystem with the noatime option, do the following: mount /home -o remount,noatime To make the change permanent, update your /etc/fstab and add noatime to the options field. For example. Before: ...


4

You should be fine with just 2 or 4 Gb of swap size, or none at all (since you don't plan hibernating). An often-quoted rule of thumb says that the swap partition should be twice the size of the RAM. This rule made sense on older systems to cope with the limited amount of RAM; nowadays your system, unless on heavy load, won't swap at all. It mostly depends ...


4

There is really only one answer to this: full disk encryption. The way full disk encryption is usually done with Linux, your /boot partition is not encrypted and contains the kernel and initramfs — just enough functionality to start a minimal environment that prompts you for the passphrase to decrypt the root filesystem and get access to everything else. ...


4

As far as I know Drav Sloan is correct: there is no universal "vi" mode setting. You can ease the pain for a lot of more modern command line programs by having a file named $HOME/.inputrc with this line in it: set editing-mode vi A lot of programs use readline, gnuplot, psql, impala-shell and others. This may get you most of way to where you want to be.


5

No stdout/stdin there at the PAM stage. You need to call pam_conv(3) via pam_get_item(3) to perform i/o. Good example at ben.akrin.com including the relevant C source example. pam_conv(3) pam_get_item(3)


3

You can simply use tr utility: tr '-' $' ' < filename Output: 123 zyx 234 yxw 345 xwv 456 wvu 567 vut 678 uts You can sed like this: sed 's/-/ /g' < filename Output: 123 zyx 234 yxw 345 xwv 456 wvu 567 vut 678 uts


3

While accessing it by /dev/sdXy is risky, a more accurate identification may be done by UUID. Since you mention (at some point) changing the usb stick, to maintain compatibility, you may want to identify your usb stick by a label. To do so, you can: /dev/disk/by-label/YourLabelHere. Note that you need to set the label to a new usb stick before running the ...


2

PAE doesn't change anything about virtual addresses. As the name hints, it's only about physical addresses. As an application programmer, PAE doesn't change anything for you. Your program still has a 32-bit address space, out of which the kernel takes approximately 1 bit (Linux grants 1GB, 2GB or 3GB to userspace depending on compilation options). If you ...


2

For the desktop environment, I would advise a DWM-based tool like DWM, awesome, or i3. Get used to a terminal multiplexer like screen or tmux. For the text editor, obviously emacs or vim. For your web browser, try vimperator, or use a plugin for firefox/chromium (VimFX or Vimium for a vim-like experience). There may be others using emacs style.


2

^=* means search for a line starting with zero or more equal signs. If you want lines starting with = just use ^=


2

The copy doesn't do any conversion itself. Basically the "conversion" happens as part of the read process. All file access is through VFS (virtual filesystem) calls. The copy reads data from one file using VFS calls and writes it to another the same way, equally for any file attributes it copies. Copy doesn't really know anything about disk formats like ...


2

On Linux the default is now Dwarf 2 and/or 4. To see this, run readelf --debug-dump=info on a binary containing debug symbols (or stripped symbols); for example, on Fedora, with glibc-debuginfo installed, running readelf --debug-dump=info /usr/lib/debug/bin/gencat.debug will give you something like <1><ea>: Abbrev Number: 0 Compilation Unit @ ...


2

GNU find or BSD find will do the trick for you: find <DIRECTORY> -type f -amin +55 -name \*<PATTERN>\* -print this will print all files with name PATTERN in DIRECTORY which where accessed greater than 55 mins ago.


2

This is how I address this problem, but generally as Sato Katsura told you, you need to write a udev rule. Plug in your device, check which device it got (for example by watching dmesg). As superuser call udevadm info --query all /dev/sdc (or whatever). Setup a udev rule, here is an example for my pocketbook. The fields ID_SERIAL_SHORT and ID_FS_UUID I ...


2

Setting a password with passwd or chpasswd generates a random salt, so users who happen to have the same password would not have identical hashes. In order to have identical hashes this way, you'd have to have a misconfigured system that somehow doesn't save entropy between reboots, and systems that are so completely identical as to repeat the random seed ...


1

This is kind of crude, but why not just blacklist the atkbd driver. echo blacklist atkbd > /etc/modprobe.d/no-atkbd.conf You'll probably need to rebuild your initrd to make sure it gets blacklisted very early on in the boot process.


1

Appears you need to install ftp. Such an insecure protocol isn't installed/enabled by default on RHEL 6. yum install proftpd will install ftp.


1

Try: fdformat /dev/fd0u720 mkfs.msdos /dev/fd0 after creating a symlink from /dev/sdh to /dev/fd0


1

awk solution: awk 'BEGIN{FS="-"} ; { print $1,$2 }' file


1

You should use <Location> instead of <Directory>. <Location /my_folder/> Order Deny,Allow Deny from all Allow from 1.1.1.1 </Location> See document on sections for Apache 2.2, Apache 2.4.


1

I would think the quickest way to do it would look something like... sed -e's/./& /g;i\' -e'<item>' \ -ea\\ -e'<tag><out>=' <file | paste -d'\0 ""' - - - ./file /dev/null This also works: ( set -- - - - - - - /tmp/file paste -d'<item> <tag><out>="' "$@" - - - - - - "$@" | sed 's/ ...


1

You can do it without loop in awk: awk '{a=$1;gsub(/./,"& ",$1); print "<item>"$1"<tag><out>=""\""a"\""}' numbers.txt Output: <item>9 3 7 4 5 4 1 6 3 2 5 5 3 <tag><out>="9374541632553" <item>5 1 2 4 3 7 4 7 8 7 9 8 4 1 <tag><out>="51243747879841" <item>3 2 0 3 0 0 9 8 8 9 6 9 1 4 ...


1

Here's one way you might be able to do the whole thing in sed: sed ' h; s/./& /g; s/.*/<item>&<tag>out=/; G; s/\n\([0-9]*\)/"\1"/; ' numbers.txt


1

Because both read and sed are taking data from stdin. In the while loop, you read the first line into $line. Then sed starts: you don't give it any other input so it reads from stdin, which is the output of cat numbers.txt. So sed will consume the rest of the input. And since you're still in the first iteration of the while loop, the $line variable doesn't ...


1

I would recommend NOT creating a swap space. 8GB of RAM is more than enough memory, especially when using a light weight system such as GNU/Linux. My laptop has 4GB of RAM with no swap space and it has compiled it's fair share of kernels, as well as ran games with no decline in performance. Swap spaces are more beneficial for those who do not have a lot of ...


1

The file listing of /etc/mtab appears to belong to /etc/alternatives! Is there any way you could have accidentally renamed /etc/alternatives to /etc/mtab? Is /etc/alternatives missing? If so, then the fix is just to rename /etc/mtab back to /etc/alternatives. If not, then you are stuck with the problem of merging the contents of the real /etc/alternatives ...


1

pae stand for physical address extension and allow a cpu with a 32bit address bus to address more than 4G. Notice that if your /proc/cpuinfo show support for pae isn't enough, you need to use a kernel compiled with pae options enabled (eg: I'm using a Debian prebuilt 3.16-2-686-pae) The memory model/layout of a Linux process is defined by the Linux kernel ...


1

"make modules_install install" tries to build initrd image on /boot partition, which has 162 megabytes free, which is simply not enough. If you want to compile kernel yourself on Ubuntu, you need to prepare at least 1GB free space on /boot partition.



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