Skip to content

Instantly share code, notes, and snippets.

View chief93's full-sized avatar

Alex Furnica chief93

  • Moldova, Chisinau
View GitHub Profile
@vladkras
vladkras / default.conf
Last active January 17, 2024 09:59
NGINX redirect to app store and google play based on user agent
location = /gotoapp {
if ($http_user_agent ~* "iphone|ipod|ipad|appletv") {
return 301 https://www.apple.com/lae/ios/app-store/;
}
if ($http_user_agent ~* "android") {
return 301 https://play.google.com/store;
}
if ($http_user_agent ~* "Windows") {
return 301 https://www.microsoft.com/store/apps?rtc=1;
@fxkraus
fxkraus / debian-install-megacli.md
Last active September 16, 2025 19:55
Install LSI MegaCli .deb package on Debian/Ubuntu

download

wget https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/8-07-14_MegaCLI.zip

unzip

unzip 8-07-14_MegaCLI.zip
@morrisdj
morrisdj / msdostounixtime.php
Created November 25, 2015 16:35
Convert MS-DOS datetime (4 byte word) to UNIX time in PHP
/** Converts DOS time to Unix time */
function dosToUnixTime($dosTime) {
$date = mktime(
(($dosTime >> 11) & 0x1f), // hours
(($dosTime >> 5) & 0x3f), // minutes
(($dosTime << 1) & 0x3e), // seconds
((($dosTime >> 21) & 0x0f) - 1), // month
(($dosTime >> 16) & 0x1f), // day
((($dosTime >> 25) & 0x7f) + 1980) // year
);
@msimonin
msimonin / commands
Last active December 29, 2023 07:09
install ubuntu on a virtual machine (libvirt / kvm)
# get the iso
wget http://releases.ubuntu.com/14.04.3/ubuntu-14.04.3-server-amd64.iso
# create the image disk
qemu-img create -f qcow2 disk.qcow2 10G
# launch the creation
virsh create ubuntu.xml
# you can connect to using vnc.
@discordier
discordier / gist:ed4b9cba14652e7212f5
Created December 4, 2014 06:23
options for phpStorm @noinspection annotation
javascript
ES6ValidationInspection
JSAccessibilityCheckInspection
JSBitwiseOperatorUsageInspection
JSCheckFunctionSignaturesInspection
JSClosureCompilerSyntaxInspection
JSCommentMatchesSignatureInspection
JSComparisonWithNaNInspection
JSConsecutiveCommasInArrayLiteralInspection