Skip to content

Instantly share code, notes, and snippets.

View dario61081's full-sized avatar
🎯
Focusing

Dario Garcia dario61081

🎯
Focusing
View GitHub Profile
@dario61081
dario61081 / mssql_recovery_suspect_bbdd.sql
Created May 31, 2021 17:24
mssql: Recovery database in suspect mode
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 April 10, 2021 02:33
funcion para convertir array o object to json
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 {
<?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 December 2, 2020 02:00 — forked from kanru/Android.mk
Android GPS using libhardware
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 September 21, 2020 16:04 — forked from Jamp/Config PyCharm
Configure for pycharm auto compile sass
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 September 18, 2020 17:13 — forked from styblope/docker-api-port.md
Enable TCP port 2375 for external connection to Docker

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 June 12, 2020 15:35
lineas de comando para instalar portainer en instancia docker
$ 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

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 April 9, 2020 23:49
inicializar vue app con vuetify
const app = new Vue({
el:'#app',
vuetify: new Vuetify()
});
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