Why does my terminal give me an error when trying to cd to another directory - oh-my-zsh

I am using iTerm and oh-my-zsh. When I try and cd into a directory on the command line I get this message Can't find a suitable configuration file in this directory or any parent: not found.
Here is an example: cd laracan't find a suitable configuration file in this directory or any parent: not found dock
.zshrc
# Path to your oh-my-zsh installation.
export ZSH="/Users/blake/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="amuse"
# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)
source $ZSH/oh-my-zsh.sh
# User configuration
# Completions Path
fpath=(/usr/local/share/zsh-completions $fpath)
## ALIASES
alias ls='ls -GFh'
alias ll='ls -al'
alias cpwd='pwd | pbcopy; pwd'
## GIT ALIASES
alias gs='git status'
# Checkout
alias co='git checkout'
alias cot='git checkout test'
# Pull and Push
alias pullo='git pull origin'
alias pusho='git push origin'
# Merge
alias gm='git merge'
alias mert='git merge test'

Related

Installation fails: informix sdk 4.50.FC7, pdo_informix 1.3.6, PHP8

I'm trying to install PDO_INFORMIX 1.3.6 with Informix-SDK 4.50.FC7 on PHP 8
and I'm running in issues even though I stick to the documentation.
Finally made it work with these settings. Might be not the optimum, but it worked for me.
# download informix sdk, go to content
./installclientsdk -i console
# ^^^^^^^^^ documentation states installclientsdk -console
# install with default settings
# for PDO: Specify Client Dir as env var
export INFORMIXDIR=/opt/IBM/Informix_Client-SDK
# add path which actually contains the files
LD_LIBRARY_PATH=$INFORMIXDIR/incl/cli:$INFORMIXDIR/lib/cli:$INFORMIXDIR/lib/esql:$LD_LIBRARY_PATH
# ^^^^^^^^^^^^^^^^^^^ cli is here, the documentation doesnt specify this
export LD_LIBRARY_PATH
# pecl / pdo
cd /install/PDO_INFORMIX-1.3.6
phpize
./configure --with-pdo-informix=/opt/IBM/Informix_Client-SDK
make
make install
# add `extension=pdo_informix.so` to the php.ini

How do I access the root of the GitHub Repository in a GitHub action?

I am trying to build a resume pdf from a resume.tex in my resume repository file whenever a commit is made.
I am getting the following error.
Error: File '/home/runner/work/resume/resume/resume.tex' cannot be found from the directory '/github/workspace'.
How should I access the resume.tex file? If I just say root_file: resume.tex, the error is:
Error: File 'resume.tex' cannot be found from the directory '/github/workspace'.
The .github/workflows/build_resume.yml file looks like this. The resume.tex file is in the root of my repository.
# This is a basic workflow to help you get started with Actions
name: Build PDF on commit.
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
# workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Github Action for LaTeX
uses: xu-cheng/latex-action#v2
with:
# The root LaTeX file to be compiled
root_file: ${{ github.workspace }}/resume.tex
# Interpret the root_file input as bash glob pattern
# glob_root_file: # optional
# The working directory for this action
# working_directory: # optional
# The LaTeX engine to be invoked
# compiler: # optional, default is latexmk
# Extra arguments to be passed to the LaTeX engine
# args: # optional, default is -pdf -file-line-error -halt-on-error -interaction=nonstopmode
# [Deprecated] Install extra packages by tlmgr
# extra_packages: # optional
# Install extra packages by apk
# extra_system_packages: # optional
# Install extra .ttf/.otf fonts.
# extra_fonts: ./fonts/*.ttf
# Arbitrary bash codes to be executed before compiling LaTeX documents
pre_compile: tlmgr update --self && tlmgr update --all
# Arbitrary bash codes to be executed after compiling LaTeX documents
post_compile: latexmk -c
# Instruct latexmk to enable --shell-escape
# latexmk_shell_escape: # optional
# Instruct latexmk to use LuaLaTeX
# latexmk_use_lualatex: # optional
# Instruct latexmk to use XeLaTeX
latexmk_use_xelatex: true
When you want to execute files from the current repository, you need to use the actions/checkout first (at the beginning of your job's steps).
This will allow you to access the repository $github_workspace (one of Github environment variables) in your workflow.
Note: All commands you'll run after using the action/checkout will be executed at the repository root.
For example, considering that your resume.tex file is at the root of the repository, you would use something like this:
name: Example
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout#v2.3.4
- name: show resume.tex file content
run: cat resume.tex
Here is another workflow example from a personal repository, following the same logic if you want to execute a specific script located in the repository in your workflow. to perform any operation.
If someone is looking to do the same, the following steps need to be done.
Go into your repository.
Compile latex document using xu-cheng/latex-action#v2
Check if PDF is generated.
Push PDF to repository.
The configuration file to do that will look like this.
name: Github Actions CI to build pdf from tex source.
on: push
jobs:
build:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout#v2
- name: Compile LaTeX document
uses: xu-cheng/latex-action#v2
with:
# The root LaTeX file to be compiled
root_file: resume_aditya_wagh.tex
# Interpret the root_file input as bash glob pattern
# glob_root_file: # optional
# The working directory for this action
# working_directory: # optional
# The LaTeX engine to be invoked
# compiler: # optional, default is latexmk
# Extra arguments to be passed to the LaTeX engine
args: -pdf -file-line-error -halt-on-error -interaction=nonstopmode
# Install extra packages by apk
# extra_system_packages: # optional
# Install extra .ttf/.otf fonts.
extra_fonts: ./fonts/*.ttf
# Arbitrary bash codes to be executed before compiling LaTeX documents
pre_compile: tlmgr update --self && tlmgr update --all
# Arbitrary bash codes to be executed after compiling LaTeX documents
post_compile: latexmk -c
# Instruct latexmk to enable --shell-escape
# latexmk_shell_escape: # optional
# Instruct latexmk to use LuaLaTeX
# latexmk_use_lualatex: # optional
# Instruct latexmk to use XeLaTeX
latexmk_use_xelatex: true
- name: Check pdf file
run: |
file resume_aditya_wagh.pdf | grep -q ' PDF '
- name: Upload file to repository
run: |
git config --global user.name "adityamwagh"
git config --global user.email "adityamwagh#gmail.com"
git add resume_aditya_wagh.pdf
git commit -m "commit message"
git push
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

How to add project.pbxproj in.gitignore

I got a merge conflict every time I try to pull or merge from gitlab.
How to deal with these kinds of files?
I won't advise you to add project.pbxproj file to .gitignore. It is an important file in the Xcode configuration bundle. It is responsible for maintaining references to all of the linked files and their groupings, linked frameworks and the project’s build settings.
Take a look at this article for further information.
However, if you want to ignore this file in the future,
commit all changes
git rm --cached /App/App.xcodeproj/project.pbxproj
add /App/App.xcodeproj/project.pbxproj (or similar) to .gitignore
commit again
project.pbxproj filein only first time upload in git and .gitignore file i'm provide to replace your .gitignore file ...
# OSX
#
.DS_Store
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
# node.js
#
*.hprof
node_modules/
npm-debug.log
yarn-error.log
yarn.lock
# BUCK
buck-out/
\.buckd/
*.keystore
!debug.keystore
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/
*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots
# Bundle artifact
*.jsbundle
# CocoaPods
/ios/Pods/

While starting apache with apachectl facing issue

When i am trying to start or stop apache with the command
/ebiz/apache/httpd/sbin/apachectl -k stop -f /ebiz/apache/httpd/conf/httpd.conf
Getting this error:-
/ebiz/apache/httpd/sbin/apachectl: line 122: ./httpd: No such file or directory
But when i am trying to execute same command from sbin location it is working fine. I am placing my apache in custom location and my apachectl is in "/ebiz/apache/httpd/sbin" location and httpd.conf is in "/ebiz/apache/httpd/conf/" location
If i look my apachectl file
#!/bin/sh
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Apache control script designed to allow an easy command line interface
# to controlling Apache. Written by Marc Slemko, 1997/08/23
#
# The exit codes returned are:
# XXX this doc is no longer correct now that the interesting
# XXX functions are handled by httpd
# 0 - operation completed successfully
# 1 -
# 2 - usage error
# 3 - httpd could not be started
# 4 - httpd could not be stopped
# 5 - httpd could not be started during a restart
# 6 - httpd could not be restarted during a restart
# 7 - httpd could not be restarted during a graceful restart
# 8 - configuration syntax error
#
# When multiple arguments are given, only the error from the _last_
# one is reported. Run "apachectl help" for usage info
#
ACMD="$1"
ARGV="$#"
#
# |||||||||||||||||||| START CONFIGURATION SECTION ||||||||||||||||||||
# -------------------- --------------------
#
# the path to your httpd binary, including options if necessary
HTTPD='./httpd'
#
#
# a command that outputs a formatted text version of the HTML at the
# url given on the command line. Designed for lynx, however other
# programs may work.
if [ -x "/usr/bin/links" ]; then
LYNX="/usr/bin/links -dump"
else
LYNX=none
fi
#
# the URL to your server's mod_status status page. If you do not
# have one, then status and fullstatus will not work.
STATUSURL="http://localhost:80/server-status"
#
# Set this variable to a command that increases the maximum
# number of file descriptors allowed per child process. This is
# critical for configurations that use many file descriptors,
# such as mass vhosting, or a multithreaded server.
ULIMIT_MAX_FILES="ulimit -S -n `ulimit -H -n`"
# -------------------- --------------------
# |||||||||||||||||||| END CONFIGURATION SECTION ||||||||||||||||||||
# Set the maximum number of file descriptors allowed per child process.
if [ "x$ULIMIT_MAX_FILES" != "x" ] ; then
$ULIMIT_MAX_FILES
fi
ERROR=0
if [ "x$ARGV" = "x" ] ; then
ARGV="-h"
fi
function checklynx() {
if [ "$LYNX" = "none" ]; then
echo "The 'links' package is required for this functionality."
exit 8
fi
}
function testconfig() {
# httpd is denied terminal access in SELinux, so run in the
# current context to get stdout from $HTTPD -t.
if test -x /usr/sbin/selinuxenabled && /usr/sbin/selinuxenabled; then
runcon -- `id -Z` $HTTPD $OPTIONS -t
else
$HTTPD $OPTIONS -t
fi
ERROR=$?
}
case $ACMD in
start|stop|restart|graceful|graceful-stop)
$HTTPD $OPTIONS -k $ARGV
ERROR=$?
;;
startssl|sslstart|start-SSL)
echo The startssl option is no longer supported.
echo Please edit httpd.conf to include the SSL configuration settings
echo and then use "apachectl start".
ERROR=2
;;
configtest)
testconfig
;;
status)
checklynx
$LYNX $STATUSURL | awk ' /process$/ { print; exit } { print } '
;;
fullstatus)
checklynx
$LYNX $STATUSURL
;;
*)
$HTTPD $OPTIONS "$#"
ERROR=$?
esac
exit $ERROR
On the line number 122 it is looking for this "$HTTPD $OPTIONS "$#"". How i can execute apache from anywhere
You can see that the path to httpd is hardcoded to the relative path ./httpd in apachectl:
# the path to your httpd binary, including options if necessary
HTTPD='./httpd'
which points to the wrong location if you're not in the right working directory.
It should be sufficient to change the path to the absolute path to the binary, i.e.
# the path to your httpd binary, including options if necessary
HTTPD=/ebiz/apache/httpd/sbin/httpd

Zsh doesn't autocomplete correctly my ssh command

I have some problem with ssh autocompletion.
I would like for my zsh to autcomplete on my .ssh/config file but until now it is only doing it with the /etc/hosts files.
I've found how to not use the hosts file by adding this configuration
zstyle ':completion:*:ssh:*' hosts off
But I cannot succeed in making zsh look into the .ssh/config files
I've tried this with little hope, but it didn't work
zstyle ':completion:*:ssh:*' config on
Here is my .zshrc file
# If you come from bash you might have to change your $PATH.
#export PATH=$HOME/bin:/usr/local/bin:/usr/local/sbin:~/Documents/workspace/flutter/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/thoma/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="agnoster"
# Set list of themes to load
# Setting this variable when ZSH_THEME=random
# cause zsh load theme from this variable instead of
# looking in ~/.oh-my-zsh/themes/
# An empty array have no effect
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git,
zsh-autosuggestions
)
# support bash autocompletion
# https://stackoverflow.com/questions/3249432/i-have-a-bash-tab-completion-script-is-t
#autoload bashcompinit
#bashcompinit
source ~/.bash_profile
if [[ -f /usr/share/bash-completion/completions/lpass ]]; then
source /usr/share/bash-completion/completions/lpass
fi
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
export PATH="/usr/local/opt/thrift#0.9/bin:$PATH"
zstyle ':completion:*:ssh:*' hosts off
zstyle ':completion:*:ssh:*' config on
If someone can help me on this ! I would gladly appreciate.
Thanks
Here's the script from the related question.
h=()
if [[ -r ~/.ssh/config ]]; then
h=($h ${${${(#M)${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*})
fi
if [[ -r ~/.ssh/known_hosts ]]; then
h=($h ${${${(f)"$(cat ~/.ssh/known_hosts{,2} || true)"}%%\ *}%%,*}) 2>/dev/null
fi
if [[ $#h -gt 0 ]]; then
zstyle ':completion:*:ssh:*' hosts $h
zstyle ':completion:*:slogin:*' hosts $h
fi
Just in case you are looking for an autocompletion both for ssh and other ssh commands like scp, the following lines do the job:
# Highlight the current autocomplete option
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
# Better SSH/Rsync/SCP Autocomplete
zstyle ':completion:*:(scp|rsync):*' tag-order ' hosts:-ipaddr:ip\ address hosts:-host:host files'
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-host' ignored-patterns '*(.|:)*' loopback ip6-loopback localhost ip6-localhost broadcasthost
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-ipaddr' ignored-patterns '^(<->.<->.<->.<->|(|::)([[:xdigit:].]##:(#c,2))##(|%*))' '127.0.0.<->' '255.255.255.255' '::1' 'fe80::*'
# Allow for autocomplete to be case insensitive
zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' \
'+l:|?=** r:|?=**'
# Initialize the autocompletion
autoload -Uz compinit && compinit -i
This is not from me, but from a blog post here: https://codyhiar.com/blog/zsh-autocomplete-with-ssh-config-file/