Skip to content

Instantly share code, notes, and snippets.

View kozmotronik's full-sized avatar
💭
I may be slow to respond.

Kozmotronik kozmotronik

💭
I may be slow to respond.
View GitHub Profile
@Juke34
Juke34 / bash_tuning.md
Last active March 20, 2024 16:10
Bash personalization
@tcpdump-examples
tcpdump-examples / iowait-linux.md
Created March 21, 2021 11:40
How to Fix io wait issue in Linux

Linux high IOwait is a common Linux performance issue. Today we will look at what iowait means and what contributes to this problem. Hope this can give you more ideas about high IOwait issue.

What is IOwait?

IO wait is related to the CPU resource on the server.

The iowait column on top command output shows the percentage of time that the processor was waiting for I/O to complete. It indicates that the system is waiting on disk or network IO. Because the system is waiting on those resources, it can not fully utilize the CPU.

Learn more about what IOwait here.

@vikpe
vikpe / fix_authenticity_of_github_problem.md
Last active September 21, 2024 22:45
FIX: The authenticity of host github.com can't be established.

Error

The authenticity of host 'github.com (140.82.113.4)' can't be established.

Fix

ssh-keyscan github.com >> ~/.ssh/known_hosts
@cetinajero
cetinajero / ddrescue.md
Last active July 1, 2024 15:45
Guide for using Ddrescue to recover data

Guide for using Ddrescue to recover data

Start command:

ddrescue -d /dev/sda output.img output.mapfile

NOTE: If direct disc access is not available in your system, try raw devices.

@moraisaugusto
moraisaugusto / 10-udisk2.rules
Last active July 20, 2024 18:45
automount partitions using polkit-1 and udisk2 - used for external disks and usb drives
// See the polkit(8) man page for more information
// about configuring polkit.
// SAVE IT ON: /etc/polkit-1/rules.d/
// replace the ntfs-3g package: ntfs-3g-fuse
// Allow udisks2 to mount devices without authentication
// for users in the "wheel" group.
polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.udisks2.filesystem-mount-system" ||
action.id == "org.freedesktop.udisks2.filesystem-mount") &&
@danielgalasko
danielgalasko / RepeatingTimer.swift
Last active September 5, 2024 07:07
A repeating GCD timer that can run on a background queue
/// RepeatingTimer mimics the API of DispatchSourceTimer but in a way that prevents
/// crashes that occur from calling resume multiple times on a timer that is
/// already resumed (noted by https://github.com/SiftScience/sift-ios/issues/52
class RepeatingTimer {
let timeInterval: TimeInterval
init(timeInterval: TimeInterval) {
self.timeInterval = timeInterval
}
@marcouberti
marcouberti / mock_android_context.java
Last active May 2, 2024 11:43
Mock Android Context using Mockito
import org.mockito.Mock;
import static org.mockito.Mockito.when;
@Mock
private Context mockApplicationContext;
@Mock
private Resources mockContextResources;
@Mock
private SharedPreferences mockSharedPreferences;
@austinglaser
austinglaser / gcov_project.yml
Created July 17, 2016 21:41
Basic configuration for Ceedling using the gcov plugin
---
# Notes:
# Sample project C code is not presently written to produce a release artifact.
# As such, release build options are disabled.
# This sample, therefore, only demonstrates running a collection of unit tests.
:project:
:use_exceptions: FALSE
:use_test_preprocessor: TRUE