Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Dario Garcia dario61081

🎯
Focusing
View GitHub Profile
@dario61081
dario61081 / mssql_recovery_suspect_bbdd.sql
Created May 31, 2021
mssql: Recovery database in suspect mode
View mssql_recovery_suspect_bbdd.sql
USE master
GO
ALTER DATABASE milleniumfox SET EMERGENCY
GO
DBCC CHECKDB (milleniumfox )
GO
ALTER DATABASE milleniumfox SET SINGLE_USER WITH ROLLBACK IMMEDIATE
@dario61081
dario61081 / pdo_tools.php
Created Apr 10, 2021
funcion para convertir array o object to json
View pdo_tools.php
function toJsonPDO($resultset)
{
$t = gettype($resultset);
if ($t === 'object') {
return json_encode(get_object_vars($resultset), JSON_NUMERIC_CHECK);
} else if ($t === 'array' && sizeof($resultset) === 1) {
return json_encode($resultset[0], JSON_NUMERIC_CHECK);
} else if ($t === 'array' && sizeof($resultset) > 1) {
return json_encode($resultset, JSON_NUMERIC_CHECK);
} else {
View export_csv.php
<?php
include_once implode(DIRECTORY_SEPARATOR, [__DIR__, 'conector.inc.php']);
const debug=true;
$format=$_GET['format']??'json';
if (debug){
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
}
@dario61081
dario61081 / Android.mk
Created Dec 2, 2020 — forked from kanru/Android.mk
Android GPS using libhardware
View Android.mk
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
gps_test.cpp
LOCAL_SHARED_LIBRARIES := \
libcutils libhardware
LOCAL_MODULE:= test-gps
@dario61081
dario61081 / Config PyCharm
Created Sep 21, 2020 — forked from Jamp/Config PyCharm
Configure for pycharm auto compile sass
View Config PyCharm
First "gem install sass" on console
Go Menu File > Settings > Tools > File Watch > "+" > "sass"
On New Window > Section Watcher Settings
Program: /<home-directory>/.gem/ruby/2.5.0/bin/sass
Arguments: --no-cache --update --no-cache --update $FileName$:../css/$FileNameWithoutExtension$.css --style compressed
Compile sass file on folder css on file minified
@dario61081
dario61081 / docker-api-port.md
Created Sep 18, 2020 — forked from styblope/docker-api-port.md
Enable TCP port 2375 for external connection to Docker
View docker-api-port.md

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@dario61081
dario61081 / docker portainer install
Created Jun 12, 2020
lineas de comando para instalar portainer en instancia docker
View docker portainer install
$ docker volume create portainer_data
$ docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
View pi-hole-setup-methode-with-bind9.md

Installation of bind9

apt install bind9

Create a virtual interface (eth0:1)

Note: i have the IP : 192.168.1.109 by DHCP

edit the network settings file

@dario61081
dario61081 / home.html
Created Apr 9, 2020
inicializar vue app con vuetify
View home.html
const app = new Vue({
el:'#app',
vuetify: new Vuetify()
});
View testing.oracle
Here module deals with source files called .fmb file which is created by us. Then output_file deals with .fmx file which is generated after compiling the .fmb file.
frmcmp_batch module=/disk5/PROD/apps/apps_st/appl/au/12.0.0/forms/US/EMP_FORM.fmb userid=apps/apps output_file=/disk5/PROD/apps/apps_st/appl/ont/12.0.0/forms/US/EMP_FORM.fmx module_type=form batch=yes