125 Matching Annotations
  1. Nov 2024
  2. Mar 2024
  3. Feb 2024
    1. The lonesome cat isn’t useless.  UUOCs are typically characterized by having exactly one filename argument; this one has none.  It connects the input to the function (which is the input of the if statement) to the output of the if statement (which is the input to the base64 –decode statement)
    1. You can pre-seed your less pager with a search pattern so that you can move between files with n/N keys: [pager] diff = diff-so-fancy | less --tabs=4 -RFXS --pattern '^(Date|added|deleted|modified): '
  4. Jan 2024
  5. Sep 2023
  6. Apr 2023
    1. --ignore-unmerged When restoring files on the working tree from the index, do not abort the operation if there are unmerged entries and neither --ours, --theirs, --merge or --conflict is specified. Unmerged paths on the working tree are left alone. Holy smokes! I guess the git-ish fix for the user interface problem here will be to rename the option from --ignore-unmerged to --ignore-unmerged-except-in-cases-where-we-do-not-want-to-allow-that--consult-documentation-then-source-code-then-team-of-gurus-when-you-cannot-figure-it-out---and-wait-while-half-of-them-argue-about-why-it-is-right-as-is-while-the-other-half-advocate-adding-four-more-options-as-the-fix.
  7. Nov 2022
  8. Sep 2022
    1. Shims are just tiny wrappers created by asdf that just forward execution to the real versioned executables installed by asdf. This way, asdf has a single shims directory added to your PATH and has no need of mangling the PATH for every installed version.
  9. Jul 2022
    1. Always use a while read construct: find . -name "*.txt" -print0 | while read -d $'\0' file do …code using "$file" done The loop will execute while the find command is executing. Plus, this command will work even if a file name is returned with whitespace in it. And, you won't overflow your command line buffer.
    1. So the correct command to use is findmnt, which is itself part of the util-linux package and, according to the manual: is able to search in /etc/fstab, /etc/mtab or /proc/self/mountinfo
  10. May 2022
    1. When running Windows on your Mac via Boot Camp, the keyboard mappings are changed so they make more sense in Windows. The Option key functions as Alt and the Command key functions as the Windows key.
  11. Apr 2022
    1. SETEX key seconds value

      Set key to hold the string value and set key to timeout after a given number of seconds.

      This command is equivalent to executing the following commands:

      SET mykey value EXPIRE mykey seconds

  12. Nov 2021
    1. Suddenly we’d come full circle. The fastest way to launch programs was to type their name into a box, only a box that looked a bit more stylish than the terminal of old.
  13. Oct 2021
  14. Sep 2021
    1. I think it's very confusing to overload common executables, such as yarn, in the /bin directory as I often put that bin directory first in my path. Thus, I'd unexpectedly get the bin/yarn rather than my system yarn, which I manage with yvm.
  15. Jul 2021
  16. Jun 2021
  17. Apr 2021
    1. ![Cosmic radiation](https://i.snap.as/T05UTpx.jpg)

      Since a lot of this is guaranteed to be seen as arcane magic, maybe this is an opportune place for the UI hooks for a conversational/palette-based UI? Maybe >> to set it off?

    1. unbuffer disables the output buffering that occurs when program output is redirected. For example, suppose you are watching the output from a fifo by running it through od and then more.    od -c /tmp/fifo | more You will not see anything until a full page of output has been produced. You can disable this automatic buffering as follows:    unbuffer od -c /tmp/fifo | more
    1. empty is an utility that provides an interface to execute and/or interact with processes under pseudo-terminal sessions (PTYs). This tool is definitely useful in programming of shell scripts designed to communicate with interactive programs like telnet, ssh, ftp, etc.
    1. The command also can be run in silent mode (tty -s) where no output is produced, and the command exits with an appropriate exit status.
  18. Mar 2021
    1. I find it convenient to change proxy and other settings through gui window by right-clicking on launcher icon on my desktop. I mostly start slack by clicking desktop launcher, but also want to be able to start it from command line in some cases.
    2. If you really want this, I suggest you write a little function that extracts the executable name from the .desktop file and runs it. Add these lines to your shell's initialization file (e.g. ~/.bashrc): runDesktop () { eval "$(awk -F= '$1=="Exec"{$1=""; print}' "$1")" } Then, you can run your .desktop file with runDesktop ~/Desktop/slack.desktop
    1. We could add heuristics like: is the file inside XDG_DATA_DIRS/applications? if not, is the file inside XDG_DATA_HOME/applications? if not, is the file marked as executable? if not, open with the text editor
    2. Hello , since I made a modification in gio-tool (#2098 (closed)) , I seen this issue and decide to give it go. I implemented an unix only solution only for launching a desktop file through gio command, see !1779 (merged)
    3. When one is searching for it on the internet, there are many many people wondering how one can open .desktop files. It seems trivial, since one usually just has to click an item on the launcher so one thinks there must be some way.
    4. I have to agree with Raphael here that this should probably be handled in gnome-open, its a pain to have to implement .desktop parsing code in every beagle front end when I can't really think of an instance where the expected behavior wouldn't be to execute the associated command.
    5. I don't know what nautilus does, but i think when you double click a .desktop file it launches the associated program, i guess they don't use gnome-open then..
    6. deskbar should probably detect their extension and execute the relevant command as opposed to opening the file for editing.
  19. Feb 2021
    1. For example, on the terminal I'm using, the right arrow outputs ^[[C. You can see what sequence your terminal outputs by pressing Ctrl-V Right Arrow. The same is true for other cursor-control keys such as Page Up and End.
    1. I think a better, more immediately understandable name for this concept would be command object, because it lets you pass around commands (or a list of commands) as objects.

      That's the only thing you really need to know abut this pattern. The rest seems like boring implementation details that aren't that important, and that naturally follow from the primary definition above.

    2. Uses
    3. The central ideas of this design pattern closely mirror the semantics of first-class functions and higher-order functions in functional programming languages. Specifically, the invoker object is a higher-order function of which the command object is a first-class argument.
  20. Dec 2020
  21. Nov 2020
  22. Oct 2020
    1. I debugged docker-compose and docker-py and figured out that you should either use environment variables or options in command. You should not mix these . If you even specify --tls in command then you will have to specify all the options as the TLSConfig object, as now TLSConfig object is created completely from the command options and operide the TFSConfig object created from the environment variable.
    1. Probably wouldn't work for capybara-based tests where it forks a different process for the web server?

  23. Sep 2020
  24. Aug 2020
  25. Jul 2020
  26. Jun 2020
    1. To get a feel for how much pseudo-random data is available in your entropy pool, you can run this command:$ cat /proc/sys/kernel/random/entropy_avail 2684 The number shown appears to represent the number of bits of entropy that have been collected. Even 2,684 might not seem like much in a world in which we routinely speak in terms of terrabytes, but numbers above 100 are said to be a good sign. I
  27. May 2020
  28. Apr 2020
    1. I had never considered it that in nearly a decade of using GNU find! Thank you for that! It will definitely change the way I think about -prune from now on.
    2. I think this structure is much easier and correlates to the right approach
    3. it isn't actually -prune itself that causes this, by the way. The issue is that the or operator "short-circuits", and or has lower precedence than and. The end result is that if a file called .snapshot is encountered it will match the first -name, -prune will then do nothing (but return true), and then the or returns true since its left-argument was true. The action (eg: -print) is part of its second argument, so it never has a chance to execute.
    4. If all you want to do is print the results you might be used to leaving out the -print action. You generally don't want to do that when using -prune.
    5. which means that it'll also print out the name of the directory you're pruning, which usually isn't what you want. Instead it's better to explicitly specify the -print action if that's what you want
    6. The thing I'd found confusing about -prune is that it's an action (like -print), not a test (like -name). It alters the "to-do" list, but always returns true.
    1. Did you expect the temp directory to get printed? In the last example, we saw the directories ./temp and ./C/temp got printed, but not now. This is the effect of the -print option. By default, the find command prints all the files matching the criteria. However, once the -print option is specified, it will print files only on explicit print instructions. In this find command, -print is associated in the other side of the OR condition, and hence nothing will get printed from the 1st part of the condition.
    2. 12. Same using the wholename option and prune to exclude directory: $ find . -wholename "./temp" -prune -o -perm 644 -print ./area.pm ./C/temp ./C/f2.c find has a switch with the name 'wholename'. Say, in your directory tree, there might be more than one temp directory. The earlier approaches will prune all the temp dierctories. In case, if the requirement is to prune a specific temp directory, then you can give the path of the directory itself. Note: The path specified in the wholename option should be relative to the search path specified, not the absolute path. 
  29. Mar 2020
  30. Jan 2020
  31. Dec 2019
    1. An ssh public key in a ~/.ssh/authorized_keys file can have a command="" option which forces a particular command to be executed when the key is used to authenticate an ssh connection. This is a security control that mitigates against private key compromise. This is great when you only need to execute a single command. But if you need to perform multiple tasks, you would normally need to create and install a separate key pair for each command, or just not bother making use of forced commands and allow the key to be used to execute any command.
    1. echo "from="${MYIP%% *}",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty,command="rsync ${SSH_ORIGINAL_COMMAND#* }" $(ssh-keygen -yf ~/.ssh/rsync_rsa)" | ssh targetserver "cat - >>~/.ssh/authorized_keys" Note that the ‘command=’ restriction (http://larstobi.blogspot.ch/2011/01/restrict-ssh-access-to-one-command-but.html) will not apply if ‘/etc/sshd_config’ has already a ‘ForceCommand’ directive.
    1. GitHub Packages uses the native package tooling commands you're already familiar with to publish and install package versions.

      Looks like GitHub Packages acts as a wrapper to these clients, acting on your behalf so you don't have to use the CLI yourself.

    1. Using find and cpio is a more unix-y approach in that you let find do the file selection with all the power that it has, and let cpio do the archiving. It is worth learning this simple use of cpio, as you find it easy to solve problems you bang your ahead against when trying tar.
    2. find
  32. Nov 2019
    1. From the man pages The environment variables can be specified in lower case or upper case. The lower case version has precedence. http_proxy is an exception as it is only available in lower case. Using an environment variable to set the proxy has the same effect as using the --proxy option
  33. Mar 2018
    1. when you ask the same people to do something FOR you, e.g. lend you a book or sign a recommendation letter for you, you can’t just use ください.

      This is like a homeless person saying "give me money, sir." It is still an order.

  34. Nov 2017
    1. In Bash you quite often need to check to see if a variable has been set or has a value other than an empty string. This can be done using the -n or -z string comparison operators.

      Two most useful commands in bash

  35. Jun 2017
  36. May 2017
    1. Every time a customer service assistant shrugs and says “computer says no” or an organization acts in crazy, inflexible ways, odds-are there’s a database underneath which has a limited, rigid view of reality and it’s simply too expensive to fix the software to make the organization more intelligent. We live in these boxes, as pervasive as oxygen, and as inflexible as punched cards.

      Isn't it interesting how the rigidity of institutionalised "old economy"-businesses and their management structure as well as their work ethics is, in a way, mimicked by their IT-architecture? Efficiency over effectiveness, stability over flexibility, repetition over creative destruction and innovation. And then came Agile...

  37. Nov 2015
    1. If you have a copy of the ReSpec repository handy, you may see that there is also a respec2html.js tool under tools/. Feel free to try using it instead of the above process, but please note that it is not used much currently and may behave in a somewhat experimental manner (experiences with it vary — but it's worth a shot if you're looking for a way to generate ReSpec output from the command line).

      Respec (sadly) doesn't quite have a command line tool...at least not one comparable to a browser's output.

      Maybe PhantomJS (which Respec uses for tests) would do a better job?

    1. Infrastructures, for Collier, are amixture of political rationality, administrative techniques, and material systems, and his interest isnot in infrastructure per se but in what it tells us about practices of government. Soviet electricityprovision, through this lens, is analyzed for how it reveals a system of total planning in a commandeconomy rather than for what it tells us about the effects of electricity on users in Russia.

      It's never really about what is in front of us when it comes to politics.. there is always more to it.. His theory is a tool we could study to learn about a country/society's government by looking at the infrastructure they've created.

  38. Sep 2013
    1. What, then, are the requisites of a good general and what ability do they involve?

      Qualities of a good leader