Skip to content

Instantly share code, notes, and snippets.

View jirkadanek's full-sized avatar
💭
🍻

Jirka Daněk jirkadanek

💭
🍻
View GitHub Profile
@lenosi
lenosi / README.md
Last active May 20, 2023 07:58
MIUI bloatware

Get list of system apps on the device:

adb shell "echo 'apps:' && pm list packages -f | grep /system/app/ | sed 's/.*=/  - /'"

Remove application command

pm uninstall -k --user 0 app
@lenosi
lenosi / README.md
Last active May 12, 2021 11:41
How to speed up Ansible a lot

Introduction

I'm working with Ansible and many of servers every day, so let me show you, how can waste less of your time! :)

What Ansible do? 

  • Connects, runs, check, sends back, processes it, runs, checks, sends back and voila!
  • Connects... again... and again... and again...

What you can do to fix on node/remote server

Edit sshd config and disable UseDNS, it's mainly used only for logging and authentication. But.. only when you have set IgnoreRhosts in your config. So who doesn't know, should use it with clean mind. Because this has truly so far with security. :)

@BrandonPotter
BrandonPotter / restart-kubectl-master-services.md
Last active February 23, 2021 17:25
Restart Kubernetes Master Services
for SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler flanneld; do
	systemctl restart $SERVICES
	systemctl enable $SERVICES
	systemctl status $SERVICES
done

restart kubelet/node services

for SERVICES in kube-proxy kubelet flanneld docker; do

systemctl restart $SERVICES

anonymous
anonymous / Scenario24Test.java
Created September 22, 2016 12:35
14:30:21,942 INFO ====== Starting (13) com.redhat.mqe.jms.tests.Scenario24Test.txClientAckWTopicDMessTs ======
14:30:22,458 WARN Store limit is 102400 mb (current store usage is 0 mb). The data directory: /home/jdanek/Work/repos/dtests/dtests/node_data/frameworks/jamq_jms_amqp_qe_units/target/com.redhat.mqe.jms.main.Scenario24/com.redhat.mqe.jms.main.Scenario24/KahaDB only has 29520 mb of usable space. - resetting to maximum available disk space: 29520 mb
14:30:22,458 WARN Temporary Store limit is 51200 mb (current store usage is 0 mb). The data directory: /home/jdanek/Work/repos/dtests/dtests/node_data/frameworks/jamq_jms_amqp_qe_units/target/com.redhat.mqe.jms.main.Scenario24/com.redhat.mqe.jms.main.Scenario24 only has 29520 mb of usable space. - resetting to maximum available disk space: 29520 mb
14:30:22,458 WARN Job Scheduler Store limit is 51200 mb, whilst the data directory: /home/jdanek/Work/repos/dtests/dtests/node_data/frameworks/jamq_jms_amqp_qe_units/target/com.redhat.mqe.jms.main.Scenario24/com.r
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active June 17, 2024 15:05
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@yoshuawuyts
yoshuawuyts / Q&A.md
Created March 16, 2016 05:58 — forked from novaluke/0-Q&A.md
I want to use Nix for development, but... -- answers to common concerns about Nix

Nix seems perfect for developers - until I try to use it...

Want to use Nix for development but you're not sure how? Concerned about the fluidity of nixpkgs channels or not being able to easily install arbitrary package versions?

When I first heard about Nix it seemed like the perfect tool for a developer. When I tried to actually use it for developing and deploying web apps, though, the pieces just didn't seem to add up.

@aphyr
aphyr / 1.txt
Created October 13, 2015 18:42
Spideroak
Aphyr
Oct 11, 9:12 PM
Hi there!
First time user here--I bought a 5TB plan for the year, checked my homedir in
"Backup", and hit save. It did a bunch of disk IO for a few minutes, then just
sat at 100% CPU for the last 8 hours. The "Scan Now" spinner is rotating and it
says "Scanning folders for new backup items". The Activity tab is empty and the
Actions log says "Application: save backup selection" is finalizing. I killed
@PurpleBooth
PurpleBooth / README-Template.md
Last active July 6, 2024 04:11
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@tony
tony / fabfile.py
Last active July 4, 2018 08:22
Can saltstack states and modules play with pure python / fabric? https://github.com/saltstack/salt/issues/22842
# -*- coding: utf-8 -*-
"""Proof of concept to use saltstack's pure modules and states with fabric::
fab list_packages print_specs -H <ip> --user=<user>
On my vagrant environment:
fab list_packages print_specs -H <ip> --password=vagrant --user=vagrant
"""

There are three easy to make mistakes in go. I present them here in the way they are often found in the wild, not in the way that is easiest to understand.

All three of these mistakes have been made in Kubernetes code, getting past code review at least once each that I know of.

  1. Loop variables are scoped outside the loop.

What do these lines do? Make predictions and then scroll down.

func print(pi *int) { fmt.Println(*pi) }