Skip to content

Instantly share code, notes, and snippets.

View ossycodes's full-sized avatar
🎯
Focusing

Osaigbovo Emmanuel ossycodes

🎯
Focusing
View GitHub Profile
@ossycodes
ossycodes / docker-compose.yml
Created May 11, 2022 21:42
ELASTIC SEARCH WITH KIBANA ONLY
version: '3.7'
services:
# Elasticsearch Docker Images: https://www.docker.elastic.co/
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.4.0
container_name: elasticsearch
environment:
- xpack.security.enabled=false
@ossycodes
ossycodes / app.js
Last active August 5, 2023 15:56
Docker compose file for Setting up Graylog for local and an app.js file to connect and send logs to Graylog
var graylog2 = require("graylog2");
var logger = new graylog2.graylog({
servers: [
{ host: "127.0.0.1", port: 12201 },
],
facility: "Test.js",
});
logger.on("error", function(error) {
@simonhamp
simonhamp / AppServiceProvider.php
Last active May 8, 2024 17:47
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@musale
musale / fix.md
Last active April 25, 2024 03:16
How to fix and recover a “corrupt history file” in zsh
# move to home directory
cd ~

# move the .zsh_history file into another .zsh_history_bad file
mv .zsh_history .zsh_history_bad

# write all printable strings into a new .zsh_history file
strings .zsh_history_bad > .zsh_history
@mrtns
mrtns / gist:78d15e3263b2f6a231fe
Last active October 11, 2023 21:20
Upgrade Chrome from Command Line on Ubuntu
# Install
# via http://askubuntu.com/questions/510056/how-to-install-google-chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
# Update
@adam-p
adam-p / Local PR test and merge.md
Last active February 5, 2024 19:39
Testing a pull request, then merging locally; and avoiding TOCTOU

It's not immediately obvious how to pull down the code for a PR and test it locally. But it's pretty easy. (This assumes you have a remote for the main repo named upstream.)

Getting the PR code

  1. Make note of the PR number. For example, Rod's latest is PR #37: Psiphon-Labs/psiphon-tunnel-core#37

  2. Fetch the PR's pseudo-branch (or bookmark or rev pointer whatever the word is), and give it a local branch name. Here we'll name it pr37:

$ git fetch upstream pull/37/head:pr37