Skip to content

Instantly share code, notes, and snippets.

View synsa's full-sized avatar

Steve Lang synsa

View GitHub Profile
@synsa
synsa / arch-i3gaps-install.md
Created August 8, 2023 06:49 — forked from fjpalacios/arch-i3gaps-install.md
Arch + i3-gaps Install Guide

Arch + i3-gaps Install Guide

First set up your keyboard layout. For example, in Spanish:

   # loadkeys es

For a list of all acceptable keymaps:

   # localectl list-keymaps
@synsa
synsa / cryptojs_base64_encrypt_decrypt.js
Created January 27, 2023 21:15 — forked from joecliff/cryptojs_base64_encrypt_decrypt.js
An example of base64 usage in cryptojs
var CryptoJS = require("crypto-js");//replace thie with script tag in browser env
//encrypt
var rawStr = "hello world!";
var wordArray = CryptoJS.enc.Utf8.parse(rawStr);
var base64 = CryptoJS.enc.Base64.stringify(wordArray);
console.log('encrypted:', base64);
//decrypt
var parsedWordArray = CryptoJS.enc.Base64.parse(base64);
@synsa
synsa / pagination.php
Created October 29, 2022 18:37 — forked from rseon/pagination.php
[PHP] Ultra simple pagination
<?php
/*
We want to display a lot of information to the screen = download a lot of HTML = lag.
LEt's go for a pagination !
*/
// Huge array with lot of dbig datas.
$my_huge_array = array();
// Setting up pagination
scan target for pentest
nmap -PN -n -A -sS -p- -oN output.nmap <IP>
-Pn : no ping check (host is up),
-n no dns resolution
-A : detect systeme info
-sT : tcp connect [laisse des traces dans les logs serveurs] (moins impactant que -sS Syn, ne laisse pas de trace dans les logs par defaut)
-p- : port de 0-65535
-oN output.nmap : write utput to file
ajouter un scan udp en parallèle -sU (dns, ipsec ...)
@synsa
synsa / array-value-recursive.php
Created September 16, 2022 07:39 — forked from itsliamjones/array-value-recursive.php
Get all values from specific key in a multidimensional array, similar to array_columns
<?php
/**
* Get all values from specific key in a multidimensional array
*
* @param string $key key(s) of value you wish to extract
* @param array $arr where you want
*
* @return null|string|array
*/
@synsa
synsa / implodeAssociativeArrayWithArrayWalk.php
Created September 16, 2022 06:18 — forked from opengeek/implodeAssociativeArrayWithArrayWalk.php
Implode an associative array using `array_walk()`
<?php
$array = array(
'key1' => 'value1',
'key2' => 'value2',
'key3' => 'value3',
);
$flattened = $array;
array_walk($flattened, function(&$value, $key) {
$value = "{$key} ({$value})";
});
@synsa
synsa / slackspotify.sh
Created September 9, 2022 19:50 — forked from jgamblin/slackspotify.sh
A Script To Set Current Spotify Song As Slack Status
#!/bin/bash
APIKEY="From Here https://api.slack.com/custom-integrations/legacy-tokens"
SONG=$(osascript -e 'tell application "Spotify" to name of current track as string')
URLSONG=$(echo "$SONG" | perl -MURI::Escape -ne 'chomp;print uri_escape($_),"\n"')
while true
do
curl -s -d "payload=$json" "https://slack.com/api/users.profile.set?token="$APIKEY"&profile=%7B%22status_text%22%3A%22"$URLSONG"%22%2C%22status_emoji%22%3A%22%3Amusical_note%3A%22%7D" > /dev/null
sleep 60
done

Overview

Cloud Build

Cloud Build is a product of GCP (Google Cloud Platform) used to build software quickly across all languages.

Function:

  • Speed up Build with VMs on Cloud without wasting personal computer’s resources.
  • Source code put on Local, Github, Cloud Source Repositories or Bitbucket all can use Cloud Build.
  • Package your source into Docker containers or non-container artifacts with build tools such as Maven, Gradle, webpack, Go, or Bazel.
  • After completing Build, the result is updated on Docker Hub or Container Registry.
  • You can be flexible to adjust the stream of Build process according to your intention.
@synsa
synsa / haproxy-config-2-1.cfg
Created June 7, 2022 23:41 — forked from haproxytechblog/haproxy-config-2-1.cfg
HAProxy 2.1 Sample Config
#
# This is the ultimate HAProxy 2.0 "Getting Started" config
# It demonstrates many of the features available which are now available
# While you may not need all of these things, this can serve
# as a reference for your own configurations.
#
# Have questions? Check out our community Slack:
# https://slack.haproxy.org/
#
@synsa
synsa / 01.php
Created May 31, 2022 18:29 — forked from smasty/01.php
10 PHP One Liners to Impress Your Friends - http://smasty.net/blog/10-php-oneliners
<? foreach(range(1, 10) as $i) echo $i * 2 . " ";