-rw------- 2 bob developers 0 Jan 22 16:34 linkToMyFile -rw------- 2 bob developers 0 Jan 22 16:34 myFile
ln: myDir: hard link not allowed for directory
lrwxrwxrwx 1 bob developers 5 Jan 22 16:36 linkToMyDir -> myDir drwx------ 2 bob developers 1024 Jan 22 16:35 myDir
echo 1 > /proc/sys/fs/protected_symlinks
(default setting on Debian Wheezy). It protects root too.
92617 1 10694 vlc /media/bob/path/to/playlist.m3u
ps aux | head -2 USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.0 166936 12236 ? Ss Sep20 1:51 /sbin/init ls -l /sbin/init lrwxrwxrwx 1 root root 20 Jun 27 20:28 /sbin/init -> /lib/systemd/systemd
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD 0 S 1000 123353 1 0 80 0 - 2730 hrtime pts/4 00:00:00 sleepthis command :
deb-src
entry in /etc/apt/sources.listapt-get source sshpass cd sshpass-1.06/ ./configure make ldd sshpasslinux-vdso.so.1 (0x00007ffe45de8000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3830e37000) /lib64/ld-linux-x86-64.so.2 (0x00007f38313da000)
make clean make SHARED=0 CC='gcc -static' not sure about theSHARED=0
part ldd sshpassnot a dynamic executable what we were trying to do
At that time, I didn't notice it, but I was also not building for the right kernel version : 2.6.32 vs 2.6.9 .
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for i686-linux-gnu-gcc... gcc -m32
checking whether the C compiler works... no
configure: error: in `.../path/to/sshpass-1.06':
configure: error: C compiler cannot create executables
See `config.log' for more details
make all-am make[1]: Entering directory '.../path/to/sshpass-1.06' gcc -static -m32 -DHAVE_CONFIG_H -I. -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.c main.c:25:23: fatal error: sys/types.h: No such file or directory #include <sys/types.h> ^ compilation terminated. Makefile:415: recipe for target 'main.o' failed make[1]: *** [main.o] Error 1 make[1]: Leaving directory '.../path/to/sshpass-1.06' Makefile:307: recipe for target 'all' failed make: *** [all] Error 2
libc6-dev-i386 - GNU C Library: 32-bit development libraries for AMD64
make all-am make[1]: Entering directory '.../path/to/sshpass-1.06' gcc -static -m32 -DHAVE_CONFIG_H -I. -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.c In file included from /usr/include/sys/ioctl.h:26:0, from main.c:28: /usr/include/bits/ioctls.h:23:24: fatal error: asm/ioctls.h: No such file or directory #include <asm/ioctls.h> ^ compilation terminated. Makefile:415: recipe for target 'main.o' failed make[1]: *** [main.o] Error 1 make[1]: Leaving directory '.../path/to/sshpass-1.06' Makefile:307: recipe for target 'all' failed make: *** [all] Error 2
sshpass: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.32, BuildID[sha1]=886a41e4c4e7631776b20a44f2262b85ad3fa240, not stripped
FATAL: kernel too old Segmentation faultIndeed :
Linux 32bitMachine 2.6.9-89.0.3.ELsmp #1 SMP Sat Jun 13 07:05:54 EDT 2009 i686 i686 i386 GNU/Linux
I compiled for a 2.6.32 kernel, while I have a 2.6.9.
I've not been able to build a binary as I wanted to. However, I've learnt some extra things in the process, which is GOOD .
Let me conclude with an inspiring quote by Bruce Lee :
Don't fear failure. Not failure, but low aim, is the crime. In great attempts it is glorious even to fail.
priority valueof a process at any given moment inside of the kernel.
PR = 20 + NI
PR = 20 + NI
with -20 ≤ NI ≤ 19
)rm: remove write-protected regular empty file 'tempDir.AVVTQONL/file1'? y Not completely happy but does it though
rm: cannot remove 'tempDir.AVVTQONL/file2': Permission denied Total disagreement. Why ?
mv: failed to access 'tempDir.AVVTQONL/file3': Permission denied "Why ?" again
To make a font available to all users, copy it into /usr/share/fonts instead.
On the Internets, some answers / comments specify ~/.fonts as the personal fonts dir, while others prefer ~/.local/share/fonts. Some even state one or the other should be preferred or is obsolete...
Don't type the commands below since I'm basically explaining here how I shot my own leg
What I meant is :$D
being an existing directory, and . the location I wanted files to land into.$d
is undefined, it is considered as an empty string, and my command becomes :
In such situation, there are not many solutions. The obvious one is to boot the computer on a rescue media, mount the partition and restore files manually to their normal location.
But another solution may save your life : BusyBox. This is a binary with lots of standard utilities (like mv, sh, ls, ...) built into it. To restore the system, you just have to :
busybox mv {bin,boot,dev,etc,lib,lib64} /
To prevent this from happening again, I considered adding set -u to ~/.bashrc, but this breaks the TAB completion. (investigate this !!!)
systemctl -a | grep resolv pppd-dns.service loaded inactive dead Restore /etc/resolv.conf if the system crashed before the ppp link was shut down. systemctl status pppd-dns.service pppd-dns.service - Restore /etc/resolv.conf if the system crashed before the ppp link was shut down. Loaded: loaded (/lib/systemd/system/pppd-dns.service; enabled) Active: inactive (dead) since Sat 2016-02-27 14:36:27 CET; 3 weeks 1 days ago Main PID: 619 (code=exited, status=0/SUCCESS) Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable. nameserver 2001:41d0:3:163::1 nameserver 2001:41d0:1:e2b8::1 systemctl disable pppd-dns.service Synchronizing state for pppd-dns.service with sysvinit using update-rc.d... Executing /usr/sbin/update-rc.d pppd-dns defaults Executing /usr/sbin/update-rc.d pppd-dns disable insserv: warning: current start runlevel(s) (empty) of script `pppd-dns' overrides LSB defaults (S). insserv: warning: current stop runlevel(s) (S) of script `pppd-dns' overrides LSB defaults (empty). /etc/init.d/pppd-dns stop update-rc.d pppd-dns remove ==> Still not working :-(This is quick and dirty, but works until I find WTF is going on :
Even though I'm rather an Emacs guy (especially when it comes to development), I've learnt the basics of Vi and I admit it's more than enough for quick edits like configuration files, crontabs, Git commit messages, ... On top of that, I don't particularly appreciate Nano and I just can't get used to its keyboard shortcuts (yeah : kinda weird in an Emacs/Vi talk, I know ), and I _always_ have to look at the bottom line reminding me of them.
Enough is enough : how can I just change that to a decent text editor ?
EDITOR
environment variable :EDITOR
value for that single command only :export EDITOR=vi|emacs|nano|
top -p $(pidof ModemManager)
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
553 root 20 0 422444 8724 7244 S 0.0 0.2 0:00.04 ModemManager
which looks BAD to me as I don't use a modem anymore.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 21267 root 20 0 317952 12544 10632 S 0.0 0.0 0:00.05 ModemManager
(should return nothing)
needle
is any word / phrase / regular expression than can "as uniquely as possible" be found in the deleted file you're trying to recoverneedle
is in the start / middle / end of the deleted file, provide -C with a value that is twice the number of lines of the deleted fileFlags (need more details): -b : recover a file even if it's missing a footer -o : output directory (?)
You can detect file encoding with : file -i fileName.
The source and destination must be distinct files.
fileToTranscode='itr_install_db_050000.ksh'; cp "$fileToTranscode"{,_BITI}; iconv --from-code=ISO-8859-1 --to-code=UTF-8 "${fileToTranscode}_BITI" > "$fileToTranscode"
Letters | charset | Comment |
---|---|---|
UU- | us-ascii | |
UU0 | iso-8859-15 | file -i reports iso-8859-15 as iso-8859-1 |
UU1 | iso-8859-1 | |
UUU | utf-8 |
Example | File type | all | ||
---|---|---|---|---|
user | group | others | ||
-rw-r--r-- | regular file |
|
||
drwxr-xr-x | directory |
|
rwx
bits is ever used : user takes precedence over group which takes precedence over other.Bit | Symbol | Number |
---|---|---|
setuid | s | 4000 |
setgid | s | 2000 |
sticky | t | 1000 If this attribute is assigned to a directory, it will prevent users from deleting each other's files. |
r | 400 for user, 40 for group, 4 for other | |
w | 200 for user, 20 for group, 2 for other | |
x | 100 for user, 10 for group, 1 for other |
An environment variable is basically just a shell variable that is available system-wide (i.e.: to sub-shells). A shell variable can be changed into an environment variable with export.
bar (empty line)In this example, the first
echo
is single-quoted, meaning it's passed as-is (without variable substitution) to the child Bash process.
(empty line) (empty line)Several things to mention here :
echo
is unquoted, which is why a \
is necessary after echo
: the whole echo $foo
is a single argument passed to bash -c, and this \
is just there to escape the space in the middle of this argument$foo
is replaced with its value in the current shell : an empty stringexport VARNAME=value
export http_proxy=http://bob:password@host:port/ export https_proxy=$http_proxy
http_proxy=http://bob:password@host:port/ https_proxy=https://bob:password@host:port/
fsInAFile on /mount/point type ext4 (rw,loop=/dev/loop0)
This has been obsoleted by systemd.
Runlevels are defined in /etc/inittab :
Runlevel | on Debianoids (source 1, 2) |
on Red Hatoids |
---|---|---|
0 | system halt | |
1 | single user mode | |
2 | full multi-user mode (default) | local multi-user mode without remote network (i.e. NFS) |
3 | full multi-user mode with network | |
4 | (not used) | |
5 | full multi-user mode with network and XDM (default) | |
6 | system reboot |
deb http://ftp.fr.debian.org/debian/ lenny stable main
to /etc/apt/sources.list to be able to install netselect-aptThe MBR can not actually store the Linux kernel itself since the kernel is about 500Kb. This is why the MBR only holds a loader that locates the kernel on the HDD then loads it into memory.
LILO itself is about 5Kb, which means still too big to fit the MBR ! Hence, LILO is split in 2 parts:At boot time, the word LILO is displayed, printing letters one by one to show the booting steps: