New answers tagged linux
0
One way could perhaps be to use amixer.
Jack plugged in:
$ amixer -c 0 contents
numid=29,iface=CARD,name='Front Headphone Jack'
; type=BOOLEAN,access=r-------,values=1
: values=on
...
Jack not plugged in:
$ amixer -c 0 contents
numid=29,iface=CARD,name='Front Headphone Jack'
; type=BOOLEAN,access=r-------,values=1
: values=off
...
So for that ...
0
Since you said "no matter how hacky" . . .
Get an external sound card that you can connect to your laptop via USB. Plug the analog jack into that. Plug in your external sound card when you want to connect the audio jack and have your bash script detect whether or not the external sound card is connected via USB.
0
man route explains
-n show numerical addresses instead of trying to determine symbolic
host names. This is useful if you are trying to determine why
the route to your nameserver has vanished.
3
Your table is basically saying:
If you want to reach another host with an IP address
starting with 192.168.0 -> send it to interface eth1
starting with 169.254 -> send it to interface eth1
starting with 127 -> send it to interface lo
else send it to your router (192.168.0.1)
The route command is a legacy command you should use the iproute tool instead.
...
0
Docker makes LXC easier to use:
Notable features
Filesystem isolation: each process container runs in
a completely separate root filesystem.
Resource isolation: system
resources like cpu and memory can be allocated differently to each
process container, using cgroups.
Network isolation: each process
container runs in its own ...
1
instead of device (/dev/sr0) name try using mount point (in your case mount point is /mem)
So just use for mount:
mount /mem
For unmount use :
umount /mnt
I have tested and Working in my side, OS is CentOS 5.8
1
It means that they'll keep backporting fixes to it for a while, but no new development/enhancement goes into it.
4
Check What does "stable/EOL" and "longterm" mean? @ https://www.kernel.org/category/faq.html
1
I finally found how-to. First, I had to add -i eth1 to my "outside" rule (eth1 is my WAN connection). I also needed to add two others rules. Here in the end what I came with :
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 8080 -j DNAT --to 10.32.25.2:80
iptables -t nat -A PREROUTING -p tcp --dport 8080 -j DNAT --to 10.32.25.2:80
iptables -t nat -A ...
3
To select words of at least 4 characters found at least 5 times and not found in /usr/share/dict/words in the PDF files in the current directory.
find . -name '*.pdf' -exec pdftotext {} - \; |
tr -cs '[:alpha:]' '[\n*]' |
tr '[:upper:]' '[:lower:]' |
grep -E '.{4}' |
sort |
uniq -c |
awk '$1 > 4 {print $2}' |
comm -23 - <(tr ...
1
Sounds like a very typical plan. I would use shell scripts to do this. You're not dealing with outrageously large quantities of text, so performance should be adequate, and shell scripts are easy to write and re-run. My first cut would be a script like this:
pdf2text files |
tr -cs '[A-Za-z]' '\n' |
tr '[A-Z]' '[a-z]' |
awk '{ if (length > 6) {print ...
1
Looking at the sample mcelog.conf config file it looks to contain most if not all of the types of triggers it can deal with.
DIMMs
[dimm]
#
# execute these triggers when the rate of corrected or uncorrected
# errors per DIMM exceeds the threshold
# Note when the hardware does not report DIMMs this might also
# be per channel
# The default of 10/24h is ...
3
Routing is about "where (and if) to send to". That's not limited to selecting a NIC. In your case routing is very simple though.
You need masquerading in its most simple form (all commands on host A):
iptables -t nat -I POSTROUTING -s 192.168.22.234 -j MASQUERADE
And maybe (if not yet) you need allow forwarding:
iptables -I FORWARD 1 -m conntrack ...
0
Try it. I did try CentOS with an uncompressed kernel and it works well with pygrub.
The almost historical reason for the compressed images is that they had to fit on a 1.44 MB Floppy.
Compression is still great if you do a network boot via low banbandwidth network.
0
RSH is very insecure - Do you really want anyone with a packet sniffer to see any passwords go over with wire, with the user id, in PLAIN TEXT?
It should have been dropped from the distros as soon as SSH was made readily available, but someone still worried that it might break someone's ancient, highly insecure, script from 1986.
RSH is bad juju!
...
3
No. Neither gpm nor the Linux kernel provide hooks for VirtualBox to inject clipboard data.
2
memmap
There is this tutorial titled: Bad Memory HowTo which discusses disabling memory via the kernel using the memmap argument to the kernel. According to the howto you have 2 options when it comes to memmap:
Turn off everything after the bad memory - (mem=###M option)
Turn off just the memory around the bad memory - (memmap=#M$###M option)
With the ...
0
This is a know bug in Ubuntu 13.04 kernels...
See Ethernet connection not stable on Ubuntu 13.04(bug exists in 32bit and 64bit version) (kernel-bug-exists-upstream).
0
I don't know who some people are, but I don't agree with them at all. sshfs is about 99% of the speed of NFS (tested) and a lot more robust. It carries with it the ability of ssh to handle the flaky nature of internet traffic without dropping, that on NFS would have you hanging with stale file handles.
I've used sshfs to mount my home directory on my box ...
0
It has been a while since I did cross compilation, but I found this description of doing cross compilation quite clear, YMMV.
Depending on your specific target there might be more specific documentation available online.
I would set up two complete new trees (one for 3.4 and one for 3.8) for compiling the kernel and not use the apt-get command as it will ...
3
You must tell apart the resizing of a block device (here: /dev/sdb4) from the resizing of a file system. A file system can be smaller but not bigger than the underlying block device.
You should make a backup of the partition table:
sfdisk -d /dev/sdb > ~/sfdisk_sdb.txt
Then you make a copy of that file and adapt the line that looks similar to this:
...
4
If you come to Distrowatch, you can search all the available distros based on ones that have categorized as being "Scientific". You might want to include "Educational" as well in that search.
I hit the search page here.
These are the results from that search:
Scientific Linux (40)
Scientific Linux is a recompiled Red Hat Enterprise Linux, co-developed by ...
0
atop, particularly recent versions, displays a raft of data on system performance. Most usefully it can be configured to run as a daemon, logging snapshots of data for future retrieval. I have it log every 60 seconds and the historic data has been invaluable.
0
While rsync doesn't let you set default options, you can create a wrapper script and put it higher up in your $PATH than the rsync binary.
This is is my rsync wrapper which lives in ~/bin/rsync
#!/bin/sh
# Set path to the rsync binary
RSYNC=/usr/bin/rsync
# Look for these exclude files
IGNORE_FILES=(~/.rsyncignore ./.gitignore ./.rsyncignore)
...
0
To see the uuid of a hard disk partition I just boot the system up with a Linux CD and goto my computer mount, click on, the partition I want to see.
The uuid number of the Linux partition will be displayed.
You can also see disk uuid by running Linux Disk utility after the Linux CD boot up.
0
In addition to what was already said you could also remove unneeded localization files, documentation, orphaned packages (if any). BleachBit is a nice complement to the GUI & CLI tools mentioned by the other posters.
0
Let me google that for you... Yes you can! This article shows how to use auditctl, ausearch, & aureport on linux kernels 2.6 and above. This one presents a fairly comprehensive guide.
I'm sure there are performance and space overhead to consider, but for anything that requires regulatory compliance or high security, it's just the cost of doing ...
2
Beside getting rid of stuff you don't use, disk analyzing tools are also helpful because they help you find stuff you don't even think about. Maybe an application forgets to clean up its old logs, maybe old backups that you forgot about and don't need anymore.
The main difference is, instead of looking for stuff that you can delete, these tools show you the ...
2
The environment (name/value pairs) lives towards the top of the stack. Figure 2 and Section 3 of Startup state of a Linux/i386 ELF binary shows about where the environment is. That doc is somewhat out of date, as ELF auxiliary vector also lives on the stack.
You can check this with a small C program:
#include <stdio.h>
int main(int argc, char ...
1
Environment variables are a manifestation of the shell you're using. I would imagine that the environment as a whole is a data structure that is part a component of what makes up a process.
I wouldn't expect them to be kept together in any singular place for all processes, rather each process more likely keeps the environment variables together with a given ...
2
Environment variables are stored together with command line arguments at the top of the process memory layout, above the stack.
2
All or much in /var/tmp can probably be removed. Much in various /var/cache-directories - eg. previously downloaded apt-packages - can be removed. In the users home-directories, thumbnails generated by various file-browsers (eg. .thumbnails) can be removed. Also the caches of various web-browsers can be removed.
3
Any up-to-date distribution would do (they are all built on more or less the same software, so not that much of a difference there). If frequent breakage is a problem, select one of the "large" ones, keep away from "here you feel the bleeding edge" distributions (yes, that means you won't run the latest GCC two days after release). Asking for very latest GCC ...
4
One of the easiest and safest thing to do is to clear the package manager cache. You did not specify which operating system or distribution you use so I will give examples for the mainstream distributions:
debian/ubuntu:
apt-get clean
fedora/red hat:
yum clean
opensuse:
zypper clean
Most, if not all, other package managers in other distributions ...
3
If you want to reclaim disk space, the best way is to uninstall applications
you don't need. List the biggest applications that are installed and check if
you really need them. Since you didn't specify your operating system here's
how to do it on Debian based systems:
aptitude search '~i' --sort installsize -F '%I %p'
Another approach is to delete user ...
2
The blacklist is read by modprobe where insmod just tries to insert a module without bothering with dependencies or blacklists or anything.
insmod man page:
insmod is a trivial program to insert a module into the kernel. Most users will want to
use modprobe(8) instead, which is more clever and can handle module dependencies.
2
Just complement the other answers that show you what types of things to anonymize in logs I thought I'd provide a list of tools that can be used to help facilitate anonymizing the logs.
TCPDUMP/pcap
The list is primarily tools for dealing with tcpdump/pcap logs. NOTE: The full list of tools and libraries is here.
AnonTool
Netflow (v5 and v9) traces in ...
3
I'd recommand you Gentoo for programming. I use it myself and it's very convenient:
latest updates with a powerful system to prevent you break all the dependencies
rolling release, so there is no jumping from a version to another
it's a compiled distribution, so they are particularly concerned with the packaging of the toolchains, and the fact you compile ...
1
Looks like this makefile includes two files (xyz.mak and pqr.mak) from its parent directory.
That seems certainly useful to me.
0
Looking in
/tmp/.ipt
/tmp/.rc_firewall
gives exactly what I was looking for: the iptables rules as they would normally be in a file like /etc/sysconfig/iptables.
I had earlier found this:
dd if=/dev/mem | strings | grep -i iptables
...and fortunately, it works on the pared-down DD-WRT filesystem. It didn't give precisely what I was looking for, but ...
1
There are many *WRT distribution variants, and different devices are set up in different ways, so I'm not sure whether this applies to your configuration, but it probably does.
The basic *WRT configuration has a read-only root filesystem, so it cannot save customizations in the filesystem. Instead, the startup loads various (variant-dependent) settings from ...
0
You do not need to the driver from realtek. I was able to use the mainlined rtl8192cu driver on Linux 3.9.1. Looking at the git log, I see that it was already available since linux-2.6.39.y (git branch --contains 663dcc73675bd70ee11195ce832b1d1691f967d0).
CONFIG_RTL8192CU must be enabled when building the kernel. Note that CONFIG_EXPERIMENTAL needs to be ...
1
Here's an idea using Perl to execute the script for you. You could translate this to your language of choice, or probably even bash. It's really the commands to connect to the wireless that count. Perl is just a means for me to do this quickly, your idea of quick may be different. A note if you're not used to reading Perl everything backticks is a shell ...
2
In RHEL/CentOS there is no -a option with passwd but -S option is there. So you run this one liner as root user:
for user in `awk -F: '{print $1}' /etc/passwd`; do passwd -S $user; done
or
for user in $(awk -F: '{print $1}' /etc/passwd); do passwd -S $user; done
2
Adding to the other two (great) answers, it's also good to realize that the process of factor separation, so important for good testing/troubleshooting, is somehow related to the act of removing the sensitive info.
In other words, whenever possible, always try to replicate your problem in a separate environment. Apart from the advantage of ruling out ...
1
At least in shadow-utils 4.1.5.1 on Arch Linux, I have -a, which also prints the status. passwd -Sa appears to do what you want. From man passwd:
-a, --all
This option can be used only with -S and causes show status for all users.
-S, --status
Display account status information. The status information consists
of 7 fields. The ...
2
The basic rule should be to expose only necessary information.
So here the basic security rules apply:
Only as much access/information as needed
Anything else should be forbidden/not readable
As you can see from many questions asked here - comments will ask for further information, if needed. But it is up to you to obfiscate personal information about ...
2
You can only have one default route ... per routing table. So at first you need to remove all default routes but one. The one route you would like your debian server to use.
For your other stuff, what you want is called "source routing", which means you perform different routing, based on the origin (source) of the currently handled packet.
This is an ...
2
Try sudo dmidecode -t baseboard for full information on the DMI table contents relevant to your baseboard, in a human readable form. For just the System Product, you can use either:
sudo dmidecode -s system-product
sudo dmidecode -s baseboard-product-name
Other relevant options for motherboard info are
sudo dmidecode -s system-version
sudo dmidecode -s ...
Top 50 recent answers are included





