Add text at the end of each line

You could try using something like: sed -n ‘s/$/:80/’ ips.txt > new-ips.txt Provided that your file format is just as you have described in your question. The s/// substitution command matches (finds) the end of each line in your file (using the $ character) and then appends (replaces) the :80 to the end of each … Read more

Laravel 5 – Clear Cache in Shared Hosting Server

You can call an Artisan command outside the CLI. Route::get(‘/clear-cache’, function() { $exitCode = Artisan::call(‘cache:clear’); // return what you want }); You can check the official doc here http://laravel.com/docs/5.0/artisan#calling-commands-outside-of-cli Update There is no way to delete the view cache. Neither php artisan cache:cleardoes that. If you really want to clear the view cache, I think … Read more

How do I call the PowerShell CLI robustly, with respect to character encoding, input and output streams, quoting and escaping?

PowerShell CLI fundamentals: PowerShell editions: The CLI of the legacy, bundled-with-Windows Windows PowerShell edition is powershell.exe, whereas that of the cross-platform, install-on-demand PowerShell (Core) 7+ edition is pwsh.exe (just pwsh on Unix-like platforms). Interactive use: By default, unless code to execute is specified (via -Command (-c) or -File (-f, see below), an interactive session is … Read more

Javac “cannot find symbol”

First, To compile the java source file using javac you need to specify the files to compile explicitly. Example: javac PathToSourceFile/FileName.java you need not provide the path if the source file is in the current working directory. Second, whenever java encounters import abc.xyz.ClassName; it tries to resolve abc/xyz/ClassName with respect to the classpath or current … Read more

Install WebExtensions on Firefox from the command line

Please see: Installing extensions Customizing Firefox: Including extensions with your distribution of Firefox The question you link on askubuntu: How to install Firefox addon from command line in scripts? is several years out of date, but does have some good information. At this point, most Mozilla add-ons, including all Firefox WebExtension add-ons, are installed manually … Read more

How to change the path to php.ini in PHP CLI version

Per http://php.net/configuration.file: php.ini is searched for in these locations (in order): SAPI module specific location (PHPIniDir directive in Apache 2, -c command line option in CGI and CLI, php_ini parameter in NSAPI, PHP_INI_PATH environment variable in THTTPD) The PHPRC environment variable. Before PHP 5.2.0, this was checked after the registry key mentioned below. As of … Read more

git log output encoding issues on Windows 10 CLI terminal

Okay, I experimented a bit and found out that Windows Git commands actually need UNIX variables like LC_ALL in order to display Polish (or other UTF-8 characters) correctly. Just try this command: set LC_ALL=C.UTF-8 Then enjoy the result. Here is what happened on my console (font “Consolas”, no chcp necessary): Update: Well, in order for … Read more