This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"regexp" | |
"strconv" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker system df | |
docker ps --size | |
docker container ls -a | |
docker container rm 4f6468cfddb2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// make p12 certificate from files | |
openssl pkcs12 -export -in client.crt -inkey client.key -certfile ca.crt -out client01.p12 -passout pass:pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@if (isset($paginator) && $paginator->lastPage() > 1) | |
<ul class="pagination"> | |
<?php | |
$interval = isset($interval) ? abs(intval($interval)) : 3 ; | |
$from = $paginator->currentPage() - $interval; | |
if($from < 1){ | |
$from = 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "DHT.h" | |
#include <Wire.h> | |
#include <LiquidCrystal_I2C.h> | |
#define DHTPIN 4 | |
LiquidCrystal_I2C lcd(0x3F, 16, 2); | |
DHT dht(DHTPIN, DHT11); | |
void setup() { | |
Serial.begin(9600); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To export | |
If it's an entire DB, then: | |
$ mysqldump -u [uname] -p[pass] db_name > db_backup.sql | |
If it's all DBs, then: | |
$ mysqldump -u [uname] -p[pass] --all-databases > all_db_backup.sql | |
If it's specific tables within a DB, then: | |
$ mysqldump -u [uname] -p[pass] db_name table1 table2 > table_backup.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /etc/nginx/sites-available/ | |
sudo touch new.site.conf | |
sudo nano new.site.conf | |
cd ../sites-enabled | |
sudo ln -s ../sites-available/new.site.conf . | |
sudo mcedit /etc/hosts | |
sudo nginx -t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// for passwords add to ht.access | |
AuthType Basic | |
AuthName "Private zone. Only for administrator!" | |
AuthUserFile /home/path/to/site.dev/.htpasswd | |
require valid-user | |
// and run command | |
htpasswd -c /home/path/to/site.dev/.htpasswd admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo npm cache clean -f | |
sudo npm install -g n | |
sudo n stable | |
# if not working | |
sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/nodejs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var loadDeferredStyles = function() { | |
var addStylesNode = document.getElementById("deferred-styles"); | |
var replacement = document.createElement("div"); | |
replacement.innerHTML = addStylesNode.textContent; | |
document.body.appendChild(replacement) | |
addStylesNode.parentElement.removeChild(addStylesNode); | |
}; | |
var raf = requestAnimationFrame || mozRequestAnimationFrame || | |
webkitRequestAnimationFrame || msRequestAnimationFrame; | |
if (raf) raf(function() { window.setTimeout(loadDeferredStyles, 0); }); |
NewerOlder