recentpopularlog in

kme : linux   1075

« earlier   later »
xorg - how to type “smart quotes” (U+201C, U+201D) - Unix & Linux Stack Exchange | https://unix.stackexchange.com/


With a Compose key:

Compose , " → „
Compose < " → “
Compose > " → ”
Compose < ' → ‘
Compose > ' → ’

You can enter the last two characters in either order, at least in most locales. There may be locales where it only works in the order Compose < " works or only in the order Compose " <.

If you need to press Shift or AltGr to enter some of these characters, you'll need to hold those modifiers down as usual. You can press and release Compose before the subsequent characters, or you can press Compose and keep it down, as you prefer.

Most keyboards don't have a key marked “Compose”, but you can configure one and your environment may already have one configured. On a PC, a popular choice is the “Menu” key between the right Windows key and the right Ctrl key. The keyboard settings of most desktop environment include an option to make this key or some other key a Compose key.
linux  x11  composekey  curlyquotes  quotes  specialcharacters  hotkey  solution 
july 2019 by kme
Th Most Handy du (Disk Usage) Commands in Linux - Make Tech Easier
Honestly did not know about the '--threshold' or exclusion options.
sysadmin  diskspace  unix  linux  du  tipsandtricks 
july 2019 by kme
OpenConnect VPN client. | https://www.infradead.org/
On Linux, it's possible to create its tun device in advance. For example:
<code class="language-bash">
# ip tuntap add vpn0 mode tun user dwmw2
</code>

This creates a device vpn0 which can be opened by user dwmw2 who can pass traffic to/from it without needing any elevated privileges. You can now tell OpenConnect to use that device by adding "-i vpn0" to its command-line arguments. Note that the /dev/net/tun device node should be readable and writeable by everyone. (Some distributions misconfigure that, so if it isn't world-writeable then please file a bug against your distribution.)
vpn  cisco  anyconnect  linux  networking  sysadmin  maybesolution 
july 2019 by kme
Linux command line character limit - Server Fault
The shell/OS imposed limit is generally very long - usually one or two hundred thousand characters.
<code class="language-bash">getconf ARG_MAX</code>

will give you the maximum input limit for a command. On the Debian system I currently have a terminal open on this returns 131072 which is 128*1024. The limit is reduced by your environment variables as if my memory serves me correctly these are passed in the same structure by the shell, though that will only take off a few hundred characters in most cases. To find an approximation of this value run env | wc -c - this suggests 325 characters at the current time on this login on this machine.

Scripts are likely to permit this full length, but it is not unlikely that other utilities will impose their own limits either intentionally or through design issues. There may also be artificial limits to how long an individual argument on a long command line can be, and/or how long a path to a file can be.
linux  shell  environmentsize  commandline  solution 
july 2019 by kme
Linux Uprising Blog
Your Linux and open source toolbox. Blog for Linux / Ubuntu / Open Source news, application reviews, tips and tricks.
linux  news  blog 
june 2019 by kme
How To Mount OneDrive In Linux Using Rclone (Supports Business And Personal Accounts) - Linux Uprising Blog
Microsoft OneDrive doesn't have an official client application for Linux, but you can access your OneDrive files from a file manager on Linux thanks to a third-party tool called Rclone. This article explains how to mount OneDrive in Linux using Rclone.
linux  onedrive  cloudstorage  cli  howto 
june 2019 by kme
Abundant Scripting Is Good | UNIX Scripting Tips and Ideas - Kimball Hawkins
I doubt there is any System Administrator out there who doesn't realize that scripting is good, but I've found there are few who actually use scripting as I feel it should be used -- as a way to programatically improve, simplify and automate many of the complex and tedious tasks of system monitoring and maintenance.…

My first rule is, if I have to do any task more than once, I’ll script it. This applies especially if errors in the command can have serious consequences.

My second rule is, if I’m going to script it, I’m going to make it robust enough to be useful in all applicable situations.

My third rule is I never hard-code specific information in a script if I can help it.

Fourth is: If a script can figure something out, don’t require the user to enter it, or choose it or find it.

Fifth is: Document it!
sysadmin  shellscripting  unix  linux  bash 
june 2019 by kme
Bash scripting cheatsheet
Has links to the Bash Hackers wiki, which are helpful.

Has a really good reference for array / associative array syntax, too!
bash  shellscripting  cli  unix  linux  cheatsheet  fuckina 
may 2019 by kme
unix - tar – extract discarding directory structure - Super User | https://superuser.com/
If you just want to remove a few path segments, then --strip-components=n or --strip=n will often do:
<code class="language-bash">
tar xvzf tgz --strip=1
</code>
unix  linux  sysadmin  tar  archive  backupandrecovery  solution 
may 2019 by kme
Ubuntu: Rename an Account [ User ID ] - nixCraft
'usermod -l newuserid olduserid', but 'groupmod -n newgroupid oldgroupid'.
ubuntu  linux  sysadmin  usermanagement  usermod  solution 
may 2019 by kme
macos - How to prevent screen from resizing my Terminal in Mac OS X? - Super User | https://superuser.com/
Disable "session-initiated terminal resizing"; PuTTY has a checkbox for this, too.
putty  iterm  solution  screen  macos  osx  linux 
may 2019 by kme
GitHub - mattn/growl-for-linux: Growl Implementation For Linux #growl4linux | https://github.com/
Growl Implementation For Linux #growl4linux. Contribute to mattn/growl-for-linux development by creating an account on GitHub.
growl  notifications  systemmonitoring  utility  software  shellenhancement  linux 
may 2019 by kme
Hyphen, En Dash, Em Dash, Minus (and their correct usage) : typography | https://www.reddit.com/

Em dash on Mac: Opt + Shift + dash
Em Win: Alt + 0151
En dash on Mac: Opt + Dash
En Win: Alt + 0150
Em dash on Linux: Compose + ---
En dash on Linux: Compose + --.
linux  mac  macos  windows  typography  dashes  composekey  specialcharacters  solution 
may 2019 by kme
Example for renaming foo? does not work as described · karelzak/util-linux@ed21c47 | https://github.com/
Was so scratching my head about this, turned out it was fixed in util-linux 2.33.1, which my Linux distro just hadn't upgraded to yet.
manpage  unix  linux  utility  software  sysadmin  solution 
march 2019 by kme
permissions - How to chmod without /usr/bin/chmod? - Unix & Linux Stack Exchange | https://unix.stackexchange.com/
You can run the loader directly, and pass it the command you want to run:
<code class="language-bash">
/lib/ld-linux.so /bin/chmod +x /bin/chmod
</code>

Your path to the loader might vary. On a 64-bit system you need to choose the right one based on how chmod was compiled; the 64-bit version is named something like /lib64/ld-linux-x86-64.so.2

The chmod utility relies on the chmod() system call (see man 2 chmod). So you could do this with a few lines of C, or just about any other language that has a wrapper around it (which would be most of them). Very few *nix systems are going to lack a C compiler and a perl interpreter; most linux distros require the later to work.
<code class="language-bash">
perl -e 'chmod 0755, "foobar.file"'
</code>
linux  unix  sysadmin  chmod  tipsandtricks  disasterrecovery 
march 2019 by kme
linux - How to use sed to remove the last n lines of a file - Stack Overflow | https://stackoverflow.com/
Yeah, it's possible in 'sed', but ugly.

<code class="language-bash">head -n -2 myfile.txt</code>
bash  linux  sed  shellscripting  textprocessing  solution 
march 2019 by kme
encryption - LUKS and loop device - Ask Ubuntu | https://askubuntu.com/
For me, what worked was:

<code class="language-bash">
head -c 100M /dev/zero > crypt
sudo cryptsetup luksFormat crypt
sudo cryptsetup luksOpen crypt
sudo mke2fs /dev/mapper/c1

# then mount with the file manager
</code>

Finally:
<code class="language-bash">
sudo cryptsetup luksClose filecontainer
</code>
crypto  blockdevice  storage  linux  howto  sortof  solution  alternativeto  truecrypt 
march 2019 by kme
pipe - cryptsetup: Attaching loopback device failed - Unix & Linux Stack Exchange | https://unix.stackexchange.com/
It seems that cryptsetup requires the LUKS header to be either regular file or device. If you need to provide the LUKS header as an output from a process/stream, you can easily circumvent the restriction by sending it to /dev/ram
<code class="language-bash">
cat LUKS-HEADER > /dev/ram0
</code>

(provided that your kernel supports ramdisk)

Then you can then simply use your cryptsetup command as:
<code class="language-bash">
cryptsetup luksOpen /dev/sdb1 sdb1 --header /dev/ram0
</code>

Keep in mind, the LUKS header will stay in /dev/ram0 disk until you free up the space. To free up the memory, you can use the blockdev command:
<code class="language-bash">
blockdev -v --flushbufs /dev/ram0
</code>
luks  crypto  blockdevices  linux  unix  sysadmin  tipsandtricks 
march 2019 by kme
linux - how to kill the tty in unix - Stack Overflow | https://stackoverflow.com/
This was essentially what I needed
<code class="language-bash">ps -ft pts/6 -t pts/9 -t pts/10</code>

And my actual command line looked like this:
<code class="language-bash">
# probably could've done this with just 'who -al' instead of who + ps
who | grep userid \
| awk '{print $2}' \
| parallel 'ps -ft {} \
| tail -n +2' \
| awk '{print $2}'
| xargs kill -HUP</code>

And with some refinement, I was able to do something like this:
<code class="language-bash">
who -al | grep old \
| awk '{print $7}' \
| sudo xargs kill -HUP</code>

Also:
I had the same question as you but I wanted to kill the gnome terminal which I was in. I read the manual on "who" and found that you can list all of the sessions logged into your computer with the '-a' option and then the '-l' option prints the system login processes.
<code class="language-bash">who -la</code>

Also:
<code class="language-bash">pkill -9 -t pts/0</code>
unix  linux  sysadmin  pseudoterminal  processmanagement  solution 
march 2019 by kme
unix - Use GNU screen as login "shell" - Super User
<code class="language-bash">
# if $STY is not set...
if [ -z "$STY" ]; then
exec screen -ARR
fi
</code>
unix  linux  sysadmin  screen  login  loginshell  solution 
march 2019 by kme
Installing and Configuring Environment Modules on CentOS 5 – Linux Cluster | https://linuxcluster.wordpress.com/
What is User Environment Modules? Taken from Environment Modules Project The Environment Modules package provides for the dynamic modification of a user's environment via modulefiles. Each modulefile contains the information needed to configure the shell for an application. Once the Modules package is initialized, the environment can be modified on a per-module basis using the…
linux  sysadmin  environmentmodules  hpc  installation  howton 
march 2019 by kme
The #! magic, details about the shebang/hash-bang mechanism | https://www.in-ulm.de/
what's special about #!

#! was a great hack to make scripts look and feel like real executable binaries.

But, as a little summary, what's special about #!? (list mostly courtesy of David Korn)

- the interpretername must not contain blanks
- the length of the #! is much smaller than the maximum path length
- $PATH is not searched for the interpreter
- (apart from an absolute path, the #! line also accepts a relative path,
- and #!interpreter is equivalent to #!./interpreter,
- however, it's not of any practical use)
- the interpreter usually must no be a #! script again
- the handling of arguments in the #! line itself is varying
- the setuid mechanism may or may not be available for the script
- there's no way to express #!$SHELL

And why shebang? In music, '#' means sharp. So just shorten #! to sharp-bang. Or it might be derived from "shell bang". All this probably under the influence of the american slang idiom "the whole shebang" (everything, the works, everything involved in what is under consideration). See also the wiktionary, jargon dictionary or Merriam-Websters. Sometimes it's also called hash-bang, pound-bang, sha-bang/shabang, hash-exclam, or hash-pling (british, isn't it?).

According to Dennis M. Ritchie (email answer to Alex North-Keys) it seems it had no name originally.
And Doug McIllroy mentioned (TUHS mailing list), that the slang for # at Bell Labs most probably was "sharp" at the time.
bourne  bash  posix  shell  shebang  unix  linux  shellscripting  history  butwhy  explained 
february 2019 by kme
The Unix Shell: Instructor Notes | https://swcarpentry.github.io/
Many people have questioned whether we should still teach the shell. After all, anyone who wants to rename several thousand data files can easily do so interactively in the Python interpreter, and anyone who’s doing serious data analysis is probably going to do most of their work inside the IPython Notebook or R Studio. So why teach the shell?

The first answer is, “Because so much else depends on it.” Installing software, configuring your default editor, and controlling remote machines frequently assume a basic familiarity with the shell, and with related ideas like standard input and output. Many tools also use its terminology (for example, the %ls and %cd magic commands in IPython).

The second answer is, “Because it’s an easy way to introduce some fundamental ideas about how to use computers.” As we teach people how to use the Unix shell, we teach them that they should get the computer to repeat things (via tab completion, ! followed by a command number, and for loops) rather than repeating things themselves. We also teach them to take things they’ve discovered they do frequently and save them for later re-use (via shell scripts), to give things sensible names, and to write a little bit of documentation (like comment at the top of shell scripts) to make their future selves’ lives better.

The third answer is, “Because it enables use of many domain-specific tools and compute resources researchers cannot access otherwise.” Familiarity with the shell is very useful for remote accessing machines, using high-performance computing infrastructure, and running new specialist tools in many disciplines. We do not teach HPC or domain-specific skills here but lay the groundwork for further development of these skills. In particular, understanding the syntax of commands, flags, and help systems is useful for domain specific tools and understanding the file system (and how to navigate it) is useful for remote access.

Finally, and perhaps most importantly, teaching people the shell lets us teach them to think about programming in terms of function composition. In the case of the shell, this takes the form of pipelines rather than nested function calls, but the core idea of “small pieces, loosely joined” is the same.

Installing Bash and a reasonable set of Unix commands on Windows always involves some fiddling and frustration. Please see the latest set of installation guidelines for advice, and try it out yourself before teaching a class.

Tab completion sounds like a small thing: it isn’t. Re-running old commands using !123 or !wc isn’t a small thing either, and neither are wildcard expansion and for loops. Each one is an opportunity to repeat one of the big ideas of Software Carpentry: if the computer can repeat it, some programmer somewhere will almost certainly have built some way for the computer to repeat it.

Building up a pipeline with four or five stages, then putting it in a shell script for re-use and calling that script inside a for loop, is a great opportunity to show how “seven plus or minus two” connects to programming. Once we have figured out how to do something moderately complicated, we make it re-usable and give it a name so that it only takes up one slot in working memory rather than several. It is also a good opportunity to talk about exploratory programming: rather than designing a program up front, we can do a few useful things and then retroactively decide which are worth encapsulating for future re-use.
shellscripting  unix  linux  shell  bash  butwhy  programming  sevenplusorminustwo  teaching  workshop  reference  advice  bestpractices 
february 2019 by kme
Linux Mint 19.1 Cinnamon Release Notes - Linux Mint | https://www.linuxmint.com/
These release notes are actually *helpful*. Covers the issue I had with garbled display on VirtualBox *and* being able to move around windows that are too large (like Timeshift's setup wizard) to fit on the screen at the default screen resolution.

The problem I had with the system menu not showing up on the first reboot after setup went away after resetting the menus (or a reboot).
If the screen is garbled when launching Linux Mint in Virtualbox, switch to console with HOST+F1 (e.g. the RIGHT Ctrl key, no ALT) and back to tty7 with HOST+F7.

Another workaround is to disable "nested paging" (in the System -> Acceleration settings) and to increase the video memory to 128MB (in the Display settings).

Note: This issue only affects the live session. You don't need these workarounds post-installation.
virtualbox  linuxmint  linux  releasenotes  virtualization  solution 
february 2019 by kme
Wonky display on this one Win10 startup screen in VirtualBox - Linux Mint Forums | https://forums.linuxmint.com/
I asked a question a few days ago about a video snow display when booting LM19 Live DVD in Virtual Box. Turns out that you need to use R-CTRL / F2 followed by R-CTRL / F7 [Host-F2, Host-F7] to go in and out of a terminal to clear the snow. Have you tried this to fix your Wonk? Maybe the Linux Graphics Drive is not really up to snuff with the Virtual Machine Host graphics. After installing the LM 19 system in the VM I have not seen snow again. Or any Wonk. Or at least now your kind of Wonk.
linuxmint  virtualization  virtualbox  graphics  linux  annoyance  solution 
february 2019 by kme
Set current working directory on ssh - Super User | https://superuser.com/
Invoke $SHELL instead.
<code class="language-bash">
ssh -t user@server 'cd /home/some/dir ; exec "$SHELL"'
</code>
unix  linux  ssh  putty  tipsandtricks  remoteexecution  sysadmin  solution 
february 2019 by kme
kragen/xcompose: for sharing .XCompose keybindings | https://github.com/
for sharing .XCompose keybindings. Contribute to kragen/xcompose development by creating an account on GitHub.
linux  x11  dotfile  composekey  specialcharacters  reference 
january 2019 by kme
« earlier      later »
per page:    204080120160

Copy this bookmark:





to read