thebashline

In Bash we trust..

Skip to content
  • Home
  • About
Search

Create string with incremental number

June 8, 2017June 8, 2017 / thebashline / Leave a comment

To create a string with an incrementing number up to 1000 using bash.

Run the below.

seq -s "$(echo -e '\ntest\n')" 1000 > output.txt

Kickstart Post output to console

February 10, 2017February 10, 2017 / thebashline / Leave a comment

If you need to view the post output from a kickstart file when debugging a problem. Add the below after the post step.

%post

exec < /dev/console > /dev/console

Ruby output

January 31, 2017January 31, 2017 / thebashline / Leave a comment

To ouput ruby add the below to the top of your .rb file.

puts caller

Fix issue with ssh using dsa

November 11, 2016 / thebashline / Leave a comment

After an update for Mac OSX sierra ssh would not allow access to dsa.

To fix this added the below to .ssh/config which fixed the problem.

Host *
HostkeyAlgorithms +ssh-dss
PubkeyAcceptedKeyTypes +ssh-dss

Fix RPM install “BAD, key ID”

June 16, 2016June 16, 2016 / thebashline / Leave a comment

If when trying to install an RPM you receive the below error. Try running the below command on the RPM affected and then put this back into your repository.

Error:

Header V4 RSA/SHA1 signature: BAD, key ID 8816c449#012

Fix:

rpm --delsign your.rpm

List sudo for another user

April 11, 2016April 11, 2016 / thebashline / Leave a comment

If you want to get permissions for another user as root.

Run the below command

sudo -U  USERHERE -l

Run Powershell command from cmd prompt

January 29, 2016 / thebashline / Leave a comment

To run a powershell command from cmd prompt just add the below. This is useful when using execute commands within chef as well.

@powershell Get-Help
execute 'powershell help' do
command '@powershell Get-Help'
action :run
end

 

Bypass Confirmation on Powershell Commands

January 29, 2016 / thebashline / Leave a comment

If your trying to automate running specific powershell commands, you can do this using the below example with -Confirm and WhatIf.

Set-ExecutionPolicy RemoteSigned -Confirm:$Y -WhatIf

 

Set timezone windows command line

January 28, 2016January 28, 2016 / thebashline / Leave a comment

To set windows timezone via command prompt.

Run the below.

tzutil /s UTC

For a list of available Timezone options run the list below.

tzutil /l 

Run remote aliased command

January 4, 2016January 4, 2016 / thebashline / Leave a comment

To run an aliased command remotely on servers. When trying to run the alias command add bash -ic to the command as show below.

bash -ic "mem"

Posts navigation

← Older posts

2003 access apache awk bash check chmod cli command command line copy cpu data date df dir directories directory disk drive esxi file files find grep init.d install ip ip address ip addresses java key large linux list log mail memory mount mysql number permissions php port process ps reboot remote remove replace rm rpm ruby run running scraping script search sed server sort space ssh string sudo tar time user vi view vmware windows xml yum zip

esxi linux Personal script windows

Archives

  • June 2017
  • February 2017
  • January 2017
  • November 2016
  • June 2016
  • April 2016
  • January 2016
  • September 2015
  • August 2015
  • June 2015
  • January 2015
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • April 2014
  • March 2014
  • January 2014
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • December 2012
  • November 2012
  • October 2012
  • September 2012
  • August 2012
  • July 2012
  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 34 other followers

thebashline

thebashline
Create a free website or blog at WordPress.com.
thebashline
Blog at WordPress.com.
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Follow Following
    • thebashline
    • Join 34 other followers
    • Already have a WordPress.com account? Log in now.
    • thebashline
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
 

Loading Comments...