Skip to content

Instantly share code, notes, and snippets.

View anjakammer's full-sized avatar

Anja Kammer anjakammer

View GitHub Profile
@anjakammer
anjakammer / Excel.php
Last active August 17, 2021 17:11 — forked from barryvdh/Excel.php
Simple php-excel class to load an Excel file into an array (using Laravel json/array interface, but you don't have to use that). Don't forget to require https://packagist.org/packages/phpoffice/phpexcel or https://packagist.org/packages/codeplex/php
<?php
use Illuminate\Support\Contracts\ArrayableInterface;
use Illuminate\Support\Contracts\JsonableInterface;
class Excel implements ArrayableInterface, JsonableInterface{
protected $objPHPExcel;
public function __construct($file){
if($file instanceof \SplFileInfo){
$filename = $file->getRealPath();
Description Error Resolution
No Jenkins service found in development namespace  anoop@myMac ~ $ jx create lile
? Pick a name for the new project: mygrpc
Created lile project at mygrpcect: (myapp)
mygrpc error: no Jenkins service be found in the development namespace!
Are you sure you installed Jenkins X? Try: http://jenkins-x.io/getting-started/
anoop@myMac ~ $
Your user account is lacking permissions, see section 'Elevate privileges for ClusterRoleBindings'
jx hangs/kubectl top node shows heavy load  anoop@myMac ~ $ kubectl top nodes | awk {'print $1 " " $3'}
NAME CPU%
gke-jx-default-pool-47e201fa-hwc9 14%
gke-jx-default-pool-47e201fa-pjmd 82%
gke-jx-default-pool-47e201fa-v3cl 23%
Increase the number of nodes atleast to 4
jenkins-maven node offline [Pipeline] node``Still waiting to schedule task``All nodes of label ‘jenkins-maven’ are offline check the status of all th
@anjakammer
anjakammer / delete-evicted-pods-all-namespaces.sh
Last active August 17, 2021 17:15 — forked from psxvoid/delete-evicted-pods-all-namespaces.sh
Delete evicted pods from all namespaces (also ImagePullBackOff and ErrImagePull)
#!/bin/sh
# based on https://gist.github.com/ipedrazas/9c622404fb41f2343a0db85b3821275d
# delete all evicted pods from all namespaces
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff state from all namespaces
kubectl get pods --all-namespaces | grep 'ImagePullBackOff' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff or ErrImagePull or Evicted state from all namespaces
@anjakammer
anjakammer / Dockerfile
Last active August 17, 2021 17:13 — forked from thom-nic/Dockerfile
Dockerfile that attempts to run the app as non-root user. This creates a `node` user & sets permissions on app files. Note you cannot `chown` files in a docker 'volume' during the build process, but you can at runtime (as part of your `CMD`) but in
###
# Node.js app Docker file
#
# Some basic build instructions:
# ```
# # you should delete node_modules b/c you don't want that copied during 'ADD'
# docker build -t thom-nic/node-bootstrap .
# # run a shell in the container to inspect the environment (as root):
# docker run --rm -itu root thom-nic/node-bootstrap /bin/bash
# ```
@anjakammer
anjakammer / userdata.sh
Created September 5, 2022 15:58 — forked from Riebart/userdata.sh
EC2 user data for setting up an EC2 instance with SSM and deploying into an ECS cluster.
#!/bin/bash
# Install the SSM agent:
# Ref: https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-install-startup-linux.html
cd /tmp
sudo yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm
sudo start amazon-ssm-agent
echo ECS_CLUSTER="ECS_CLUSTER_NAME" >> /etc/ecs/ecs.config
export PATH=/usr/local/bin:$PATH
@anjakammer
anjakammer / README.md
Created April 13, 2023 12:25 — forked from LongLiveCHIEF/README.md
Run node, npm, npx, yarn as container

Developing with Node, without installing node!

Note: currently only works on *nix systems (until a powershell script can be created)

With the technique below, you can run node, npm, npx, or yarn commands as if the programs were installed natively on your system, and you won't even know the difference! This includes any ports that your app or dev process will start up and use for development, as well as compatibility with persistent npm config --global cli usage.

See more in the Usage section below.

@anjakammer
anjakammer / installing-postman.md
Created September 28, 2023 16:00 — forked from pmkay/installing-postman.md
Installing Postman on Ubuntu/Gnome

Since Chrome apps are now being deprecated. Download postman from https://dl.pstmn.io/download/latest/linux

Although I highly recommend using a snap

sudo snap install postman

Installing Postman

tar -xzf Postman-linux-x64-5.3.2.tar.gz