recentpopularlog in
« earlier   later »
perldebug - perldoc.perl.org
Put this in ~/.perldb to get a persistent history between sessions:
<code class="language-perl">parse_options("HistFile=$ENV{HOME}/.perldb_history HistSize=1000");</code>
perldb  debugger  configfile  history  essential  movein  solution 
november 2019
How can I conditionally use a module in Perl? - Stack Overflow
String eval is I think what I had to do to make a conditional 'use' statement for Text::MultiMarkdown, falling back to Text::Markdown.
perl  eval  exceptionhandling  sortof  solution 
november 2019
Bookmarklet · Issue #20 · kognise/water.css
<code class="language-javascript">javascript:(()=%3E{let%20a=document,b=b=%3Ea.querySelectorAll(b),d=(b,c)=%3EObject.assign(a.createElement(b),c);b(%22link[rel=\%22stylesheet\%22],style%22).forEach(a=%3Ea.remove()),b(%22*%22).forEach(a=%3Ea.style=%22%22),a.head.append(d(%22link%22,{rel:%22stylesheet%22,href:%22//cdn.jsdelivr.net/gh/kognise/water.css%40latest/dist/light.css%22}),d(%22meta%22,{name:%22viewport%22,content:%22width=device-width,initial-scale=1.0%22}))})()</code>
css  stylesheet  readability  bookmarklet 
november 2019
What the heck are you actually using NoSQL for? - High Scalability -
Has an impressive list of references at the bottom, for further reading.
API limiting. This is a great fit for Redis as a rate limiting check needs to be made for every single API hit, which involves both reading and writing short-lived data.
webdevel  devel  database  dba  architecture  nosql  explained  butwhy  forethereferences 
november 2019
bash - 'man' page is too narrow (not taking advantage of terminal size) - Unix & Linux Stack Exchange
Today I learned (more 'strace' tricks):
<code class="language-bash">grep groff log | sed 's/\], \[.*//'
# result:
# 28721 execve("/usr/bin/groff", ["groff", "-mtty-char", "-Tutf8", "-mandoc", "-rLL=171n", "-rLT=171n"</code>
So, something like this will give you the line length you want (since most of the time 'man` is doing some magic to autodetect your terminal width):
<code class="language-bash">
wget -qO - https://opensource.apple.com/source/file_cmds/file_cmds-212/stat/stat.1 \
| groff -man -Tutf8 -rLL=${COLUMNS}n \
| less
</code>
Only '-rLL=XXn' is required; the title length is inferred from that, if not otherwise specified.
unix  linux  manpage  groff  terminalwidth  solution 
november 2019
shell - Print man pages with fixed width - Unix & Linux Stack Exchange
Use the MANWIDTH environment variable:
<code class="language-bash">MANWIDTH=60 man apropos > apropos.txt</code>
unix  manpage  groff  til  solution  linewidth  wrapping 
november 2019
linux - Change width of man command ouput - Stack Overflow
<code class="language-bash">MANWIDTH=80
export MANWIDTH
man bash</code>
unix  linux  manpage  man  80columns  solution 
november 2019
API Reference: iOS Manual Pages | https://developer.apple.com/
This is missing section 1 of the manual, so not so useful. See https://pinboard.in/u:kme/b:64ae11e07786 for a comprehensive list of still-accessible references.
macos  darwin  ios  bsd  developer  manpages  reference 
november 2019
documentation - Does Apple provide a web site with content of `man` pages for the command-line commands bundled with Mac OS X? - Ask Different | https://apple.stackexchange.com/
It's like playing whack-a-mole. In 2019, almost 2020, the suggestion to do a web search for "site:opensource.apple.com/source stat.1" is probably still the state of things.

See https://pinboard.in/u:kme/b:64ae11e07786 for a comprehensive list.
macos  ios  bsd  darwin  manpages  reference  developer  annoyance  maybesolution 
november 2019
Converting a Bash array into a delimited string - Stack Overflow | https://stackoverflow.com/
So, basically:
<code class="language-bash">a=(one two three)
(IFS='|'; echo "${a[*]}")
# one|two|three
</code>

Also, this was a clever use of some 'man' options I'd never used before.
<code class="language-bash">man -Len -Pcol\ -b bash | sed -ne '/^ *IFS /{N;N;p;q}'</code>

Alternative:
<code class="language-bash">
ids=( 1 2 3 4 )
IFS=\| eval 'lst="${ids[*]}"'
</code>
bash  arrays  manpage  man  tipsandtricks  shellscripting  solution  fuckina 
november 2019
The Auranaut - People Want To Be Needed (Original Mix) |Barracuda| 1999 - YouTube
"You can't avoid pain by fencing yourself off, sometimes you need the help of other people more than anything else.....but you have to let them get close enough to help.....people want to be needed, I found that out too"


--> "Sinking the Bismark" (https://www.youtube.com/watch?v=Fmm22DYp-xY)
trance  90s  quote 
november 2019
Does anyone know this quote? "You can't avoid pain by fencing yourself off" keep reading for the rest of it? | Yahoo Answers
Also in Zayaz's "People Want To Be Needed," which I heard on DI.fm's Synthwave channel.
Does anyone know this quote? "You can't avoid pain by fencing yourself off" keep reading for the rest of it?

'You can't avoid pain by fencing yourself off... Sometimes you need the help of other people more than anything else... People want to be needed... I've been through it myself... I know...'

This is from the year 2000 or so. It was used in a very popular trance track by Auranaut. The song is called People Want To Be Needed. Listen to this track on youtube and see if you can recognize the voice or quote. I think it is from a movie?! Thanks for any help!

From the comments:
I think it's called Sink The Bismarck.

--> https://www.youtube.com/watch?v=Fmm22DYp-xY
synthwave  sample  quote  film 
november 2019
filter - Search user with empty attributes - Stack Overflow | https://stackoverflow.com/
To filter for an empty attribute you need an LDAP filter saying "attribute telephoneNumber does not have any value":

<code>(!(telephoneNumber=*))
</code>
ldap  solution 
november 2019
Print to STDERR in AWK - Google Groups
I forgot the quotes around "/dev/stderr" is all:
<code class="language-awk">print "foo" > "/dev/stderr"</code>
unix  linux  shellscripting  awk  errormessage  stderr  solution 
november 2019
perl - Escape angle brackets using Pod::Markdown - Stack Overflow
I sort of had this problem, but my formatter was actually Pod::Usage, and it turns out POD has its own escapes for this "E<lt>" and "E<gt>".
perl  pod  funnycharacters  escapecharacter  sortof  solution 
november 2019
linux - crontab PATH and USER - Stack Overflow
According to the man 5 crontab, "The value string is not parsed for environmental substitutions or replacement of variables".
crontab  environmentvariables  configfile  solution 
november 2019
Easy SSH and SCP Tunneling Using ProxyJump in Your SSH Config · Jeet Sukumaran
you can make life a lot simpler by setting up your ~/.ssh/config file to make use of the ProxyJump feature:
<code class="language-sshconfig">Host gateway
HostName gateway.institution.edu
User username1
Port 2222
Host remote1
HostName remote1.institution.edu
User username2
ProxyJump gateway</code>

Now you can just:
<code class="language-bash">ssh remote1</code>
ssh  tunneling  remoteaccess 
november 2019
monitoring - Is there a tool that allows logging of memory usage? - Unix & Linux Stack Exchange
Valgrind and syrupy (https://github.com/jeetsukumaran/Syrupy) are two options.

Also ('pidstat -r' is what you want):

The pidstat command also from the sysstat package provides a fairly nice interface for reporting statistics on single process. – Steven D Jan 13 '11 at 22:21


Today I learned:
Occasionally when the need arises I just do:
<code class="language-bash">$ top -d 1 -b |grep <process> >>somefile</code>

It's not an elegant solution, but gets the job done if you want the quick crude value to verify your hypothesis.
sysadmin  memory  systemmonitoring  profiling  debugging  maybesolution 
november 2019
rt/rt.in at stable · bestpractical/rt
Has an interactive shell, built-in help, and a dispatcher for command line options.
perl  commandline  tui  samplecode  inspiration 
october 2019
macos - Changing xterm color definitions breaks X11 - Super User
So I guess the answer is to put that stuff in ~/.Xdefaults, since I couldn't get an obvious answer as to whether ~/.Xresources was read on startup, or whether I needed to create a ~/.xinitrc to read it in with 'xrdb'.
On my Mac OS X 10.5.8, I changed the color background of the Xterm (X11) by adding the following lines to the file .Xdefaults:
macos  osx  x11  xquartz  xdefaults  xresources  solution 
october 2019
XTerm introduction and TrueType fonts configuration
My ~/.Xdefaults
<code class="language-xdefaults">! source: http://futurile.net/2016/06/14/xterm-setup-and-truetype-font-configuration/
xterm*background: Black
xterm*faceName: Input Mono
xterm*faceSize: 12
xterm*foreground: grey
! enables "UTF-8 Encoding" and "UTF-8 Fonts" menu options
xterm*locale: UTF-8

xterm*VT100.Translations: #override \
Shift <KeyPress> Insert: insert-selection(CLIPBOARD) \n\
Ctrl Shift <Key>V: insert-selection(CLIPBOARD) \n\
Ctrl Shift <Key>C: copy-selection(CLIPBOARD) \n\
Ctrl <Btn1Up>: exec-formatted("xdg-open '%t'", PRIMARY)</code>
x11  xterm  configuration  xrdb  xresourcess  howto  macos  osx  xquartz  solution  fuckina  essential  movein 
october 2019
Longest Common Prefix in perl - René Seindal - Living in Venice
<code class="language-perl">\
#!/usr/bin/perl
use strict;
use warnings;
sub longest_common_prefix {
my $prefix = shift;
for (@_) {
chop $prefix while (! /^$prefix/);
}
return $prefix;
}
print longest_common_prefix(@ARGV), "
";</blockquote</code>
perl  string  substring  prefix  matching  samplecode  solution 
october 2019
escaping double quotes and percent signs (%) in cron - Server Fault
You have to escape the % signs [with backslashes]. They have a special meaning in crontabs:
cron  crontab  shellscripting  sysadmin  dammitbrain  solution 
october 2019
3.5mm headphone jack to Optical audio (TO… - Apple Community
I have a macbook pro from 2010. Before I buy one I was wondering if I can use a 3.5mm (headphones jack) to optical audio cable (Toslink) to have sound from my macbook pro run through my surround sound system? Anyone know if this works? My surround sound system definitely has the optical audio input.
macbookpro  mac  hardware  audio  toslink 
october 2019
[SOLVED] XCode 7 and Qt error | Qt Forum
In my case the error
<code>clang: warning: no such sysroot directory</code>
was caused by Xcode.app being in an Applications/Developer subdirectory, and some part of the build process not expecting that.

The fix was to move it back to /Applications and run 'sudo xcode-select -s /Applications/Xcode.app'.
xcode  errormessage  anoyance  build  toolchain  clang  maybesolution 
october 2019
awk · Serious Shell Programming
Localized function variables declared in the argument scope should be preceded by eight (8) spaces to separate them from the intended function arguments. If the arguments and locals together would exceed 79 characters, separate arguments and locals with a newline.


This is because (from the man page):
Functions may be defined (at the position of a pattern-action statement) thus:

function foo(a, b, c) { ...; return x }

Parameters are passed by value if scalar and by reference if array name; functions may be called recursively. Parameters are local to the function; all other variables are global. Thus local variables may be created by providing excess parameters in the function definition.
awk  shellscripting  styleguide  syntax  functions  newbie 
october 2019
« earlier      later »
per page:    204080120160

Copy this bookmark:





to read