2020年10月30日 星期五

sa

 C:\Users\anderson\AppData\Roaming\Grasshopper\UserObjects

C:\Users\anderson\AppData\Roaming\Grasshopper\Libraries

2020年10月29日 星期四

python

 https://solarianprogrammer.com/2017/02/25/install-numpy-scipy-matplotlib-python-3-windows/

111

  Dim conString As String = "Server=192.168.0.208;Port=5432; Userid=confluence_user;Password=e_user; Protocol=3;SSL=false;Pooling=true;Mi" & _

      "nPoolSize=1; MaxPoolSize=20;Encoding=UNICODE; Timeout=15;SslMode=Disable;Database=confluence"

        Dim ourDataTable As DataTable = Nothing

        Dim ourDataTable2 As DataTable = Nothing

        Dim tmpdata As String = ""

        Dim connection As Npgsql.NpgsqlConnection = New Npgsql.NpgsqlConnection(conString)

        ' Try

        ourDataTable = New DataTable

        Dim ourAdapter As Npgsql.NpgsqlDataAdapter = New NpgsqlDataAdapter("SELECT distinct sp.permid, sp.permtype, s.spacekey, s.spacename, sp.permgroupname, um.user_name " & _

           "FROM SPACEPERMISSIONS sp " & _

"JOIN SPACES s ON sp.spaceid = s.spaceid " & _

"LEFT JOIN cwd_user um ON sp.permusername = um.user_name where sp.permtype='SETSPACEPERMISSIONS' AND s.spacekey='" & no & "'", connection)

        'ourAdapter.SelectCommand.Parameters.AddWithValue("@no", no)

        ourAdapter.Fill(ourDataTable)


        'MsgBox(no & "<br>")

        For i As Integer = 0 To ourDataTable.Rows.Count - 1

            tmpdata += ourDataTable.Rows(i)("user_name") & "/"


        Next

        Return tmpdata

        'If IsDBNull(no) Then

        '    Return ""

        'Else


        'End If

        ' Catch ex As Exception

        ' End Try

    End Function





Dim conString As String = "Server=192.168.0.208;port=5432; Userid=confluence_user;Password=confluence_user; Protocol=3;SSL=false;Pooling=true;Mi" & _

 "nPoolSize=1; MaxPoolSize=20;Encoding=UNICODE; Timeout=15;SslMode=Disable;Database=confluence"

        Dim ourDataTable As DataTable = Nothing

        Dim connection As Npgsql.NpgsqlConnection = New Npgsql.NpgsqlConnection(conString)

        connection.Open()

        Dim exl_ap As New Excel.Application

        Dim exl_wkb As Excel.Workbook

        Dim exl_wks As Excel.Worksheet


        Dim j As Integer = 2


        '定義存檔路徑及檔案名稱

        Dim sPath, sFilename As String

        sPath = Application.StartupPath.ToString

        sFilename = "\db\" & Format(Now, "yyyyMMdd") & ".xls"


        exl_wkb = exl_ap.Workbooks.Open(sPath & "\employee.xls", , True) '這個TRUE是Readonly  

        exl_wks = exl_wkb.Worksheets("sheet1")  ' exl_wks = exl_wkb.Worksheets(1) 同等意思

        '或者 exl_wks = exl_wkb.ActiveSheet 也行



        '標題  Header

        With exl_wks

            .Name = Format(Now, "yyyyMM")

            .Range("A" & j).Value = "員工編號"

            .Range("B" & j).Value = "員工姓名"


            .Range("A1:E1").Interior.ColorIndex = 6  '顏色

            .Cells().ColumnWidth = 10  '欄位寬度

        End With

        Dim objWriter As New System.IO.StreamWriter(sFilename)

        '抓DB  GetDataSet函數省略不介紹

        Dim cmd As New NpgsqlCommand("SELECT spaceid,spacename from spaces", connection)

        'cmd.CommandText = "SELECT EmployeeID, FirstName, LastName FROM Employee ORDER BY EmployeeID"

        Dim lrd As NpgsqlDataReader = cmd.ExecuteReader


        While lrd.Read()

            ' objWriter.WriteLine(lrd.Item(0) & ", " & lrd.Item(1))

            ' If loDS.Tables(0).Rows.Count > 0 Then

            '內容 Content

            '   For i As Integer = 0 To loDS.Tables(0).Rows.Count - 1

            j += 1

            With exl_wks

                .Range("A" & j).Value = lrd.Item(0).ToString().Trim()

                .Range("B" & j).Value = lrd.Item(1).ToString().Trim()

            End With

            ' Next

            ' End If

        End While

        'Dim FILE_NAME As String = "C:\db\EmployeeList.xls"

        'Dim objWriter2 As New System.IO.StreamWriter(sFilename)

        objWriter.Close()

        'objWriter2.Close()



        'Dim sqlstr, lcReturn As String


        'Dim loDS As New DataSet

        'sqlstr = "select empid,firstName,jobtitle,Case when sex='M' then '男' when sex='F' then '女' else null End as gender " & _

        '         ",Convert(varchar(10),startdate,111) as startdate from dbo.OHEM "

        'lcReturn = GetDataSet(sqlstr, loDS, "OHEM")

        '判斷是否有錯誤訊息


        '存檔

        '  exl_ap.SaveWorkspace() '另開視窗

        exl_wkb.SaveAs(sFilename)

        '   exl_ap.Visible = True



        '  exl_wks = Nothing


        '   exl_wkb.Close()

        '  exl_wkb = Nothing


        '  exl_ap.Quit()

        '  exl_ap = Nothing

        '  MsgBox("匯出完成!!")

        GC.Collect()

2020年10月28日 星期三

link

 http://ck.itpison.com/HL/2965b6d5/36a3cff4/0/2f63987/38c8a91/37e3821/bc8/1311/800.htm


https://zoom.us/w/97579185132?tk=g1nE1MWZRln8712_YTgzebhlFfTq2meTXM04VoLppW4.AG.MEkbF6YhraEbgUzvr4n_JIdPIHDJwRqnLDCFmfdWJkY-uJ2oj_MsxyPEghaqpqX43TONuU6hJiJErZ8LNpKLsTPvJSlfzFeE.y4wTbJ5qldYqL7rk8o_Hyw.2WZyJQ-nAkvLXwph&uuid=WN_STNXQA1rT4uRN8Kk3RZMhQ

2020年10月23日 星期五

info

 https://tw.answers.yahoo.com/question/index?qid=20120724000010KK03981


https://docs.google.com/forms/d/e/1FAIpQLSeYsD9ZQXKvIMzdUteTaCeAUUDhk7BjjbCe4-ItK7WpvnzRsQ/viewform?fbclid=IwAR2CifLptd4F3G5z7ZHptb3_tzyJXpxe9RxhBvX7KunxOpogFjfrSaF1Rmw

2020年10月20日 星期二

download2

 https://ektron0116.neocities.org/software/download2.zip


https://wikidll.com/microsoft/mfplat-dll


https://tw.easeus.com/backup-recovery/fix-bad-image-error-windows-10.html

2020年10月18日 星期日

systemd-timer

 https://cfarm.blog.aznc.cc/%E4%BD%BF%E7%94%A8-systemd-timer-%E4%BB%A3%E6%9B%BF-crontab/

2020年10月16日 星期五

rsync

 https://www.digitalocean.com/community/tutorials/how-to-use-rsync-to-sync-local-and-remote-directories-on-a-vps


https://blog.gtwang.org/linux/rsync-local-remote-file-synchronization-commands/



https://www.jordanvanbergen.nl/post/170153757314/how-to-setup-rsync-without-password-using-ssh-on

2020年10月14日 星期三

autocad

 https://www.youtube.com/playlist?list=PLHpUx0YTjD_ctoHTYCmbO_CEC1-qYkQ_X

2020年10月12日 星期一

safa

 https://ektron0116.neocities.org/software/license.zip

33

 if [ "$(ls -l $INPUT_DIR/${INPUT_FILE_PREFIX}cons*.csv.gz | wc -l)" = "1" ]

2020年10月11日 星期日

da

 https://serverfault.com/questions/160581/how-to-setup-passwordless-sudo-on-linux

2020年10月4日 星期日

RE2

 https://confluence.atlassian.com/confkb/how-to-list-all-pages-restricted-to-a-specific-group-951412334.html

RE

 ELECT c.contentid, c.title, s.spacekey, cps.cont_perm_type, cp.groupname

FROM SPACES s
JOIN CONTENT c ON s.spaceid = c.spaceid
JOIN CONTENT_PERM_SET cps ON c.contentid = cps.content_id
JOIN CONTENT_PERM cp ON cps.id = cp.cps_id
WHERE cp.groupname = '<group_name>';

c

 #!/bin/sh

if [ls /var/atlassian/application-data/confluence/index/plugin/usage -lR|grep "^-"| wc -l ] = 13

then

rsync -av /var/atlassian/application-data/confluence/index/plugin/usage/* /home/anderson/index

mv /home/anderson/index/home/anderson/indextest

else

rsync -av /var/atlassian/application-data/confluence/index/plugin/usage/* /home/anderson/index

mv /home/anderson/index /home/anderson/indexok

fi


2020年10月3日 星期六

excel and linux command

 https://ithelp.ithome.com.tw/questions/10200008


https://dotblogs.com.tw/chou/2011/10/24/46165

copy

 SELECT sp.permid, sp.permtype, s.spacekey, s.spacename, sp.permgroupname, um.user_name

FROM SPACEPERMISSIONS sp

JOIN SPACES s ON sp.spaceid = s.spaceid

LEFT JOIN cwd_user um ON sp.permusername = um.user_name

2020年10月1日 星期四

do

 https://confluence.atlassian.com/confkb/how-to-list-which-spaces-a-group-can-access-720636535.html


If my understanding is correct, one way to do is to create a shell script, this is when Confluence is running as service:

cat confluence_auto_start.sh
#!/bin/bash

# stop Confluence
sudo /etc/init.d/confluence stop

# wait for 5 minutes
sleep 5m

# start Confluence
sudo /etc/init.d/confluence start

Now, execute this shell script in the background using nohup as shown below. This will keep executing the script even after you logout from your session. You'll need system administrator permissions in order to edit and manually run jobs and start/stop CConfluence using the Confluence user.

 Please keep note that support for cronjobs/scheduling tasks falls outside the scope of our Support Offerings, so our exposure to it is limited and we suggest you try them in your test environment first.

Please let us know if you have any questions. 

sample

Imports Microsoft.VisualBasic

Imports System.Data

Imports System.Data.SqlClient

Imports Npgsql

Imports NpgsqlTypes

Partial Public Class Udf 

 Public Shared Function eipConnectionString() As String

        '資料庫連線字串

        Dim connString As String = ConfigurationManager.ConnectionStrings("researchConnectionString").ConnectionString

        Return connString

    End Function

    Public Shared Function checkid(ByVal iNumber As String) As String

        '(0:預約 1:未審核 2:審核過  3:第一階段)

        Dim tempValue As String = String.Empty

        Select Case iNumber

            Case "President"

                'A0_經營理念

                tempValue = " Wang"

                Exit Select

           

        End Select

        Return tempValue

    End Function