View autopgsqlbackup
#!/bin/bash | |
# | |
# PostgreSQL Backup Script Ver 1.0 | |
# http://autopgsqlbackup.frozenpc.net | |
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com> | |
# | |
# This script is based of the AutoMySQLBackup Script Ver 2.2 | |
# It can be found at http://sourceforge.net/projects/automysqlbackup/ | |
# | |
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9 |
View pgsql_backup.sh
#!/bin/bash | |
# | |
# Backup a Postgresql database into a daily file. | |
# | |
BACKUP_DIR=/pg_backup | |
DAYS_TO_KEEP=14 | |
FILE_SUFFIX=_pg_backup.sql | |
DATABASE= | |
USER=postgres |
View export.cs
using DocumentFormat.OpenXml; | |
using DocumentFormat.OpenXml.Packaging; | |
using DocumentFormat.OpenXml.Spreadsheet; | |
using System; | |
using System.Collections.Generic; | |
using System.Data; | |
using System.Data.SqlClient; | |
using System.IO; | |
using System.Linq; |
View pagination.sql
declare @PageNumber int = 1,@PageSize int = 1000000 | |
------------------------------------ | |
--method 1 | |
declare @edge int | |
select @edge = @PageNumber * @PageSize | |
select top (@PageSize) (SELECT ID | |
, UID |
View redis.cs
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
using StackExchange.Redis; | |
using System; | |
using System.Collections.Generic; | |
using System.Configuration; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Threading; |
View bcp.cs
using System; | |
using System.Collections.Generic; | |
using System.Configuration; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace YOURPROJECTNAMESPACE | |
{ |
View cmd.cs
public static void RunCmd(string command) | |
{ | |
System.Diagnostics.Process proc = new System.Diagnostics.Process(); | |
proc.StartInfo.FileName = "app name like bcp"; | |
proc.StartInfo.Arguments = command; | |
proc.Start(); | |
proc.WaitForExit(); | |
} |
View scp.cs
using System; | |
using System.Collections.Generic; | |
using System.Configuration; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using WinSCP; | |
namespace YOURPROJECTNAMESPACE |
View crossapply.sql
--The APPLY operator should do the trick: | |
SELECT * | |
from MarketDataMaster | |
cross apply dbo.fn_MarketDataDetails (MarketDataMasterID) | |
--This essentially calls the function once per row returned from MarketDataMaster. "cross apply" works like an inner join, in that only rows for which data is returned by the function will be returned; use "outer apply" for functionality similar to left outer joins. |
View config.txt
init_uart_clock=16000000 # set uart clock to 16mhz | |
kernel_old=1 # load kernel.img at physical memory address 0x0 | |
safe_mode_gpio=8 # a temp firmware limitation workaround | |
max_usb_current=1 # enable maximum usb current | |
gpu_mem=32 | |
hdmi_force_hotplug=1 # enable hdmi display even if it is not connected (640x480) |
NewerOlder