Categories
Linux Mastering Development

How can I write a bash script to check the 5 high memory consumption processes runs on Linux?

#!/bin/bash ps -eo pid,user,ppid,%mem,%cpu,cmd –sort=-%cpu | head | tail -n +2 | awk ‘{print $1}’ > /tmp/long-running-processes.txt echo “————————————————–” echo “UName PID CMD Process_Running_Time” echo “————————————————–” for userid in `cat /tmp/long-running-processes.txt` do username=$(ps -u -p $userid | tail -1 | awk ‘{print $1}’) pruntime=$(ps -p $userid -o etime | tail -1) ocmd=$(ps -p $userid | […]

Categories
Linux Mastering Development

Environment variables when running unshare

Is there any namespace (process, user, etc) that isolates environment variables? In case there is, what happens when you unshare? Do they get cloned? What happens if a process changes an existing variable? EDIT: I am using Ubuntu

Categories
Mastering Development

Splitting columns into rows from a text file using unix shell script – Dynamically changing source file structure

I’ve a tab seperated source file with this structure: Only the first 9 columns from ID to Line Item/Property is fixed, rest are all dynamic varying in count and structure. ID Date/Time (UTC) User Description Security Change Previous Value New Value Module/List Line Item/Property Scenarios Region EM2 Plan Item PB6 Market EM4 Plants – Master […]

Categories
Mastering Development

AttributeError: ‘str’ object has no attribute ‘meta_index’ – CONVOKIT

I am working with this dataset. When I try: from convokit import Corpus, User, Utterance user_meta_dict = user_df.drop_duplicates(‘user’).set_index(‘user’)[survey_cols].to_dict(orient=’index’) corpus_users = {k: User(owner=k, meta=v) for k,v in user_meta_dict.items()} Below is full traceback: AttributeError Traceback (most recent call last) <ipython-input-9-0abdf9f9aef4> in <module> —-> 1 corpus_users = {k: User(owner=k, meta=v) for k,v in user_meta_dict.items()} <ipython-input-9-0abdf9f9aef4> in <dictcomp>(.0) —-> […]

Categories
Mastering Development

insert xml into mysql

hello i try to insert some data in xml file into a mysql, i need to inser data codice into reference column and data qta in quantity column Xml is: <dispo> <codice>CA031BL</codice> <arrivi> <arrivo> <maga>B</maga> <data>2020-04-01</data> <qta>0</qta> </arrivo> </arrivi> <codice>CA031BL</codice> <arrivi> <arrivo> <data>2020-04-01</data> <maga>C</maga> <qta>30</qta> </arrivo> </dispo> in php file i’ve insert this: connection to […]

Categories
Mastering Development

how to filter field in openerp xml

i want to filter products which falls under chargeback number class given below class stock_picking_return_batch(osv.osv): _name = “stock.picking.mass.return” _rec_name = ‘chargeback’ _columns = { ‘partner_id’: fields.many2one(‘res.partner’, ‘Customer’, required=True, ), ‘chargeback’: fields.char(‘Charge Back / Batch#’, size=45, required=True, ), ‘create_uid’: fields.many2one(‘res.users’, ‘User’, ), ‘received_date’: fields.datetime(‘Received Date’, required=True, ), ‘line_ids’: fields.one2many(‘stock.picking.return.line’, ‘batch_id’, ‘Return Lines’, ), ‘product_id’: fields.many2one(‘product.product’, ‘Product’, […]

Categories
User Help

Arch Linux – Cannot mount SMB Share with mount.cifs, but gvfs and smbclient work

I am trying to access a NAS over a Cisco AnyConnect VPN. I can access it fine on: Macbook (Finder’s “Connect to server”) Windows 10 (Map Network Drive) Arch Linux gvfs (thunar and gio mount) Arch Linux smbclient I used to be able to mount the same share just fine, but suddenly one, day it […]

Categories
Linux Mastering Development

Environment variables when running unshare

Is there any namespace (process, user, etc) that isolates environment variables? In case yes, What happens when you unshare? Do they get clonned? What happen if a process changes an existing variable? Thanks!

Categories
Bitcoin Cryptocurrency Mastering Development

Bitcoin core Rpc EOF?

I using regtest to test bitcoin core rpc in golang. package main import ( “fmt” “github.com/toorop/go-bitcoind” ) const ( SERVER_HOST = “127.0.0.1” SERVER_PORT = 18444 USER = “test” PASSWD = “1234” USESSL = false ) func main() { bc, err := bitcoind.New(SERVER_HOST, SERVER_PORT, USER, PASSWD, USESSL) if err != nil { fmt.Println(err) } result, err […]

Categories
Mastering Development

Q: How to dynamically expand records

I have a use-case where I have multiple columns containing records that I want to expand dynamically. Meaning that the name of the columns to expand is not hardcoded. Expanded = Table.ExpandRecordColumn(Source, “HardcodedColumnName”, {“fieldname”}, {“fieldname”}), My M code snipped below can expand records dynamically based on a transformation table. But I cannot get my head […]