Why is Ruby throwing a syntax error whenever I use the gem command?

This is the first time I've attempted to work with Ruby. I wanted to install sass so I updated gem and attempt to install sass but was thrown an error. I then realized that the syntax error was raised whenever I ran gem - I can't figure out what coul...
more »

Map over two arrays with jq and merge objects inside

I have two arrays of identical length with objects in them: input: [[{foo: 1}, {foo: 23}], [{bar: 12, baz: 543}, {bar: -1}]] How do I tell jq to merge them into one array like below? output: [{foo: 1, bar: 12, baz: 543}, {foo: 23, bar: -1}] ...
more »

chaining grep commands to return values from different lines

I have a large log file where I am currently running two commands. I search the log group and then make a filtered file where I return the following 3 lines after a match: cat testFile.log |grep 'Text I am looking for' -A 3 > filter.txt Then on...
more »

How to use git namespace to hide branches

Background I'm working with a large team using git for version control. The normal flow is: People selecting a ticket from the "backlog queue". Working on the issue via a local branch (i.e. git checkout -b my_feature_branch). Making several commit...
more »

Find folder without specific subfolder

I am looking for a way to go through a set of folders in a unix terminal and list the folders that don't have a certain subfolder. So, say I have 5 folders, each containing subfolders with numbers 1-5, 2 folders don't have the subfolder number 2 and...
more »

Run app and launch browser from command line

I want to start my app from the command line and automatically start a browser and show a default page (as it is run from IDE). I tried with this command: dotnet run --launch-profile "MyApp" In My app launchSettings.json I have defined: "MyApp": ...
more »

SVN update via Task Scheduler Locking the target folder, requiring Cleanup

I'm trying to keep a central work folder up to date with Tortoise SVN, and updating it daily has gotten tedious. I've used the below in commandline to update successfully: svn up --accept tc \\localhost\MySubfolder\MySubSubfolder\targetfolder ...
more »

Cannot install gems (tar: Cannot connect to C: resolve failed)

When attempting to install a gem, but I am getting this error: C:\WINDOWS\system32>gem install sqlint Temporarily enhancing PATH for MSYS/MINGW... Building native extensions. This could take a while... ERROR: Error installing sqlint: ER...
more »

command find with -or and exec malfunctioning

If I execute find . -name "*FOO*" -or -name "*foo*" It works perfectly, returning 106 files with the upper-case FOO and 4 files with the lower-case foo. If I add the exec ls syntax like this find . -name "*FOO*" -or -name "*foo*" -exec ls -ld ...
more »

Is there a way to make a console application run using only a single file in .NET Core?

In .NET framework, you can make a single .EXE file that will run from the command line without having any extra config files (and if using ILMerge, you can put all .DLL references into the 1 .EXE assembly). I am taking a stab at using .NET Core to a...
more »

What does "[]" or "<>" mean in some command document?

In some command documents, there are often "[]" or "<>". For example: git diff [options] [<commit>] [--] [<path>…​] git diff [options] --cached [<commit>] [--] [<path>…​] git diff [options] <commit> <commi...
more »

How can I find a file within a specific directory name?

So I need to find all files in /home/ with a file name of "options.php". find . -name "options.php" When 'in home', that will find all options.php files, however, I want to only find all options.php files when they are in /public_html/. So in othe...
more »

Merge pdfs in a grid

I have hundreds of pdf files representing cards for a card game. They are standard 2.5"x3.5" files build using LaTeX. In order to print them I want to concatenate them together into a single pdf with 9 cards per page (the most that can fit). Currentl...
more »

Empty dump() output in Symfony CLI

I'm building a simple Symfony-shell script to test my Symfony app on interactive mode: # bin/app_dev_cli.php require __DIR__.'/../app/autoload.php'; $kernel = new AppKernel('dev', true); // Initialize bundles and container$kernel->boot(); // ...
more »

checkout dialogues box crashes automatically even after installation of Rabbitvcs and it's component

Installed Rabbitvcs but when i try to checkout the code, dialogues box crashes automatically step performed: sudo add-apt-repository ppa:rabbitvcs/ppa sudo apt-get update sudo apt-get install rabbitvcs-nautilus3 sudo apt-get install rabbitvcs-ged...
more »

git checkout -b dev origin/dev being stopped by file I can't stash or ignore

I have just cloned the repo from a project I'm working on. We clone from the *master but then I need to checkout and create a local dev branch as the is what we commit our code to and the *master is locked to commits. As soon as the clone finished...
more »

Some characters stick to my colorized prompt in Python cmd

I am using Python 2's cmd module to make a command line for a program. Everything works nicely as long as I don't add color to my prompt. Working code: from cmd import Cmd class App(Cmd): def __init__(self): Cmd.__init__(self) ...
more »

I'm using following command to automate svn update using TortoiseSVN C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe /command:log /path:"c:\MyRepo\" But I don't want to save svn login on the GUI. So how can i feed the login on this command? ...
more »

Using variable arg names with argparse

I have an upstream system that invokes my program with varying arg names. Example: foo --xyz1 10 --xyz2 25 --xyz3 31 I would like the result of argparsing to be a xyz = [10, 25, 31]. The names of my args have a common prefix, but unfortunately ha...
more »

Revert all files with a specified name

Hi i want to revert all changes to the files with a specific filename in a local repository. In this case AssemblyInfo.vb, i'm using the TortoiseSVN cli. I have the following directory structure Root Project 1 File1.txt My Project AssemblyIn...
more »

Merging 3 separate commands into one that re-encodes a video, extracts a thumbnail, delete original and rename new video in subdirectories

I am trying to execute a find bash command to process hundreds of video files that are all named video-original.mp4 but are in subdirectories of a parent directory. Here's an example of the directory structure: videos ├── 01a │   └─
more »

Remote install of multiple R packages (with, without depends) from Ubuntu CLI

I have to perform a remote R installation on an Ubuntu 16.10 system. As part of this, I have to install specific packages on that host. I want to install these packages Rcmdr,list,ggplot2,afex,lsmeans. Since I am doing this remotely, I cannot use su...
more »

How do I test if a file is writable (CLI)

I am taking my first steps in Dart today, and the first thing I am not sure about how to proceed is how to test whether a file that is passed as an argument to a CLI tool I'm writing is writable. So the idea is that I have a tool that accepts an inp...
more »

Compile F# program in Linux using command line

With C, I can write a program with a generic text editor (i.g. nano) and compile it in the Lunix terminal with gcc mySum.c -o mySum to get a window asking for inputs and returning the output. #include <stdio.h> int main(){ int x; ...
more »

more »

Ruby script start from a specific line or method

Let's say i have a script: !#usr/bin/ruby # step 1 puts "That's first" # some code #step 2 puts "That's second" # some code Is there a way to pass ARGV to script that will start execution from a specific line (or step, or class, or whatever)? Fo...
more »

more »

Convert Maple online examples into raw text entry?

Maple's online help pages render all of the inputs (and outputs) as fancy math (MathJax). I guess the assumption is that you're using the visual IDE. However, I only have access to a terminal with ASCII entry (e.g., via SSH). How can I can convert t...
more »

Does a PHP process exit when you ctrl + c it from CLI?

I'm witnessing strange disk activity on one of our servers. The only thing I can think of is that during the day a lot of PHP processes were started from CLI in screen mode, like so: php -f myprocess.php As soon as I noticed the disk issue, I term...
more »